MCP Server
The Model Context Protocol (MCP) is an open protocol for connecting AI applications to external services. Movk Nuxt Docs ships an MCP Server built on @nuxtjs/mcp-toolkit. Once connected, assistants such as Claude and Cursor search and read your docs when they need to instead of answering from training data.
The server is on by default and lives at the site's /mcp path. If your docs are deployed at https://docs.example.com, the MCP URL is https://docs.example.com/mcp. AI Chat reads the docs through the same tools.
Configuration
Disable
MCP is controlled by the movkNuxtDocs.mcp feature flag. When off, @nuxtjs/mcp-toolkit is not installed as a module, and both /mcp and the MCP server card go away:
export default defineNuxtConfig({
movkNuxtDocs: {
mcp: false
}
})
nuxt generate deployment.Name and browser redirect
The remaining options live under mcp and are read by @nuxtjs/mcp-toolkit:
export default defineNuxtConfig({
mcp: {
// Server name shown to clients
name: 'My Docs',
// Page to redirect to when /mcp is opened in a browser
browserRedirect: '/docs/ai/mcp'
}
})
browserRedirect also becomes the documentation URL in the MCP server card. See the MCP Toolkit docs for more options.
Built-in capabilities
Tools
| Tool | Purpose | Main parameters |
|---|---|---|
search-documentation | Search pages by title, path or description; lists every page with no parameters | search, section, locale |
get-documentation-page | Return one page as Markdown by path, optionally only the named H2 sections | path, headings |
search-composables | Find composable pages by keyword | search, locale |
get-component | Return component documentation with metadata, optionally only some sections | componentName, sections, locale |
get-component-metadata | Return a component's props, slots and emits | componentName, full, locale |
list-examples | List every example name | None |
get-example | Return an example's source code | exampleName |
search-icons | Search one Iconify collection, lucide by default | query, collection, limit |
The component and example tools rely on the component docs feature and return nothing when it is off. search-composables looks for pages whose path contains composables/ (such as /docs/composables/ or /docs/reference/composables/); get-component and friends look for pages whose path contains /components/.
Resources
| URI | Content |
|---|---|
resource://docs/documentation-pages | Title, description and path of every page |
resource://docs/components | Component pages with their category and keywords |
resource://docs/composables | Composable pages |
resource://docs/examples | Example names |
Resources list default-language content only.
Prompts
| Prompt | Purpose |
|---|---|
find-component-for-usecase | Recommend a component for a use case |
implement-component-with-props | Generate an implementation from a component's docs and metadata |
Multiple languages
With internationalization enabled, the tools taking locale and both prompts query that language's collection and /{locale}/docs prefix, falling back to the default language when omitted. An unregistered locale answers 400 with the available locales. get-documentation-page resolves by path directly, such as /en/docs/getting-started.
Restrict tools
A client can send an X-MCP-Tools header (comma-separated tool names) to expose only the tools it needs and save context:
- No header: every tool is exposed
- Empty value: no tools are exposed
- An unknown tool name: the server answers 400
The filtering is implemented by the layer's server/mcp/index.ts; the Cursor section below shows a client configuration.
Connect a client
The server uses the HTTP transport. Replace https://docs.example.com/mcp with your URL.
Claude Code
claude mcp add --transport http my-docs https://docs.example.com/mcp
Cursor
Or create .cursor/mcp.json at the project root:
{
"mcpServers": {
"my-docs": {
"type": "http",
"url": "https://docs.example.com/mcp",
"headers": {
"X-MCP-Tools": "search-documentation,get-documentation-page"
}
}
}
}
Remove headers to expose every tool.
Visual Studio Code
Requires the GitHub Copilot and GitHub Copilot Chat extensions.
Or add it to .vscode/mcp.json:
{
"servers": {
"my-docs": {
"type": "http",
"url": "https://docs.example.com/mcp"
}
}
}
Claude Desktop
Add the server to claude_desktop_config.json, opened from "Settings → Developer → Edit Config", then restart the app:
{
"mcpServers": {
"my-docs": {
"command": "npx",
"args": ["mcp-remote", "https://docs.example.com/mcp"]
}
}
}
Opencode
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"my-docs": {
"type": "remote",
"url": "https://docs.example.com/mcp",
"enabled": true
}
}
}
ChatGPT
In ChatGPT on the web, turn on developer mode under "Settings → Connectors → Advanced settings", then create a connector with your MCP server URL and None as authentication.
Once connected, just ask: "list every docs page", "read the installation guide", "which props does ComponentProps accept?". The assistant picks the tools itself.
Extend
The server loads the files under your project's server/mcp/ and merges them with the layer's definitions.
Custom tools
import { z } from 'zod'
import { queryCollection } from '@nuxt/content/server'
export default defineMcpTool({
description: 'Search page titles and descriptions by keyword',
annotations: {
readOnlyHint: true,
destructiveHint: false,
idempotentHint: true,
openWorldHint: false
},
inputSchema: {
search: z.string().describe('Keyword')
},
cache: '30m',
async handler({ search }) {
const event = useEvent()
const keyword = search.toLowerCase()
const pages = await queryCollection(event, 'docs')
.select('title', 'description', 'path')
.all()
return pages.filter(page =>
page.title?.toLowerCase().includes(keyword)
|| page.description?.toLowerCase().includes(keyword)
)
}
})
The tool name defaults to the file name in kebab-case. A file named after a built-in tool (such as server/mcp/tools/search-documentation.ts) replaces it.
Custom resources
import { queryCollection } from '@nuxt/content/server'
export default defineMcpResource({
uri: 'resource://docs/page-index',
description: 'Title and path of every page',
cache: '1h',
async handler(uri: URL) {
const pages = await queryCollection(useEvent(), 'docs')
.select('title', 'path')
.all()
return {
contents: [{
uri: uri.toString(),
mimeType: 'application/json',
text: JSON.stringify(pages, null, 2)
}]
}
}
})
Custom prompts
import { z } from 'zod'
export default defineMcpPrompt({
description: 'Explain what a config option does and its default',
inputSchema: {
key: z.string().describe('Option path, e.g. header.nav')
},
async handler({ key }) {
return {
messages: [{
role: 'user' as const,
content: {
type: 'text' as const,
text: `Read the app.config reference and explain the purpose, type and default of ${key}.`
}
}]
}
}
})
Replace the default handler
The layer's server/mcp/index.ts is the default handler and implements the X-MCP-Tools filter. Create a file at the same path in your project to replace it:
import { defineMcpHandler, getMcpTools } from '@nuxtjs/mcp-toolkit/server'
export default defineMcpHandler({
async tools(event) {
return getMcpTools({ event, orphansOnly: true })
}
})
AI Chat
Turn on the built-in AI assistant for your docs site. Covers the enable conditions and dependencies, model and endpoint routing, adding other providers, and the component and composable API, so readers can ask the docs directly within minutes.
Agent Skills
Publish the Agent Skills in your project's skills/ directory under /.well-known/skills/ together with the docs site, so readers install them into Claude Code, Cursor and other assistants with one command. Covers layout, naming, publishing and the two built-in skills.