Advanced Topics
Advertise your server in llms.txt
Let agents discover your MCP server through llms.txt.
An MCP endpoint is only useful if agents know it exists. Most clients need a human to paste a URL into a config file, which means your server stays invisible to any agent that discovers your site on its own.
llms.txt is the convention agents already fetch to understand a site. When nuxt-llms is registered alongside this module, the toolkit appends an ## MCP Server section to /llms.txt describing your endpoint — no configuration required.
Setup
Add nuxt-llms alongside the toolkit:
Terminal
npx nuxi module add nuxt-llms
nuxt.config.ts
export default defineNuxtConfig({
modules: ['@nuxtjs/mcp-toolkit', 'nuxt-llms'],
llms: {
domain: 'https://example.com',
title: 'Example',
description: 'Everything about Example.',
},
mcp: {
name: 'Example MCP',
description: 'Query Example data from your agent.',
browserRedirect: '/docs/mcp',
},
})
/llms.txt then contains:
llms.txt
# Example
> Everything about Example.
## MCP Server
Query Example data from your agent.
- [Example MCP](https://example.com/mcp): Streamable HTTP endpoint — connect an MCP client to this URL to call the tools, resources and prompts exposed by this site.
- [MCP documentation](https://example.com/docs/mcp): How to connect to this MCP server.
What ends up in the section
| Source | Used for |
|---|---|
llms.domain + mcp.route | The absolute endpoint URL |
mcp.name | The endpoint link label |
mcp.description | The section description (falls back to a generated sentence) |
mcp.browserRedirect | An extra documentation link, when set to something other than / |
The section is built through the
llms:generate hook that nuxt-llms calls while rendering the file, from your resolved configuration. Note that nuxt-llms prerenders /llms.txt, so its contents — including llms.domain — are baked at build time.Opting out
Set mcp.llms to false to leave /llms.txt untouched:
nuxt.config.ts
export default defineNuxtConfig({
mcp: {
llms: false,
},
})
The toolkit also steps aside automatically when your llms.sections already contains a section titled MCP Server, so you can document the endpoint yourself without ending up with duplicates:
nuxt.config.ts
export default defineNuxtConfig({
llms: {
domain: 'https://example.com',
sections: [
{
title: 'MCP Server',
description: 'Our own wording wins.',
links: [{ title: 'Endpoint', href: 'https://example.com/mcp' }],
},
],
},
})
nuxt-llms isn't a dependency of this module — when it isn't installed, nothing is registered and there is no runtime cost.