MCP Server

Every docs site serves a Model Context Protocol server at /mcp by default. This page lists the built-in tools, resources and prompts, shows how to connect Claude Code, Cursor, VS Code and other clients, and explains how to disable, restrict or extend the server.
View source

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:

nuxt.config.ts
export default defineNuxtConfig({
  movkNuxtDocs: {
    mcp: false
  }
})
MCP cannot be disabled while AI Chat is enabled; the build fails if you try.
The MCP Server needs a running server and is unavailable on a fully static nuxt generate deployment.

Name and browser redirect

The remaining options live under mcp and are read by @nuxtjs/mcp-toolkit:

nuxt.config.ts
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

ToolPurposeMain parameters
search-documentationSearch pages by title, path or description; lists every page with no parameterssearch, section, locale
get-documentation-pageReturn one page as Markdown by path, optionally only the named H2 sectionspath, headings
search-composablesFind composable pages by keywordsearch, locale
get-componentReturn component documentation with metadata, optionally only some sectionscomponentName, sections, locale
get-component-metadataReturn a component's props, slots and emitscomponentName, full, locale
list-examplesList every example nameNone
get-exampleReturn an example's source codeexampleName
search-iconsSearch one Iconify collection, lucide by defaultquery, 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

URIContent
resource://docs/documentation-pagesTitle, description and path of every page
resource://docs/componentsComponent pages with their category and keywords
resource://docs/composablesComposable pages
resource://docs/examplesExample names

Resources list default-language content only.

Prompts

PromptPurpose
find-component-for-usecaseRecommend a component for a use case
implement-component-with-propsGenerate 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

Terminal
claude mcp add --transport http my-docs https://docs.example.com/mcp

Cursor

Install MCP in Cursor

Or create .cursor/mcp.json at the project root:

.cursor/mcp.json
{
  "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.

Install MCP in VS Code

Or add it to .vscode/mcp.json:

.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:

claude_desktop_config.json
{
  "mcpServers": {
    "my-docs": {
      "command": "npx",
      "args": ["mcp-remote", "https://docs.example.com/mcp"]
    }
  }
}

Opencode

opencode.json
{
  "$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

server/mcp/tools/search-pages.ts
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

server/mcp/resources/page-index.ts
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

server/mcp/prompts/explain-config.ts
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:

server/mcp/index.ts
import { defineMcpHandler, getMcpTools } from '@nuxtjs/mcp-toolkit/server'

export default defineMcpHandler({
  async tools(event) {
    return getMcpTools({ event, orphansOnly: true })
  }
})
See the MCP Toolkit docs for multiple handlers, sessions, authentication and other advanced setups.
Copyright © 2024 - 2026