TockDocs LogoTockDocs
AI

MCP Server

Connect your documentation to AI tools with a native MCP server.

About MCP Servers

The Model Context Protocol (MCP) is an open protocol for connecting AI applications to external tools and data sources.

Every TockDocs instance includes a built-in MCP server so AI tools such as Claude, Cursor, VS Code, Windsurf, and Zed can search and read your documentation.

Accessing Your MCP Server

Your MCP server is available at the /mcp path of your documentation URL.

If your documentation is hosted at https://docs.example.com, your MCP server URL is https://docs.example.com/mcp.

Disable the MCP Server

If you want to disable the MCP server, do so in nuxt.config.ts:

nuxt.config.ts
export default defineNuxtConfig({
  mcp: {
    enabled: false,
  },
})

Built-in Tools

TockDocs exposes three built-in tools.

search-pages

Searches titles, descriptions, headings, paths, and full page body content.

ParameterTypeDescription
querystring (required)Search query or natural-language question
limitnumber (optional)Maximum number of results to return
kbstring (optional)Knowledge base id to scope results in multi-KB sites
localestring (optional)Locale code to scope results

search-pages uses FlexSearch for the primary pass and Fuse.js as a fuzzy fallback.

list-pages

Lists available documentation pages with their titles, paths, descriptions, and URLs.

ParameterTypeDescription
kbstring (optional)Knowledge base id to scope results in multi-KB sites
localestring (optional)Locale code to scope results

get-page

Retrieves the full markdown content of a specific documentation page.

ParameterTypeDescription
pathstring (required)Exact page path

Examples:

  • KB mode: /docs/manual/en/getting-started/installation
  • legacy i18n mode: /en/getting-started/installation
  • legacy single-locale mode: /getting-started/installation

KB-aware behavior

In multi-KB sites:

  • external MCP clients can pass kb and locale explicitly to search-pages and list-pages
  • the built-in assistant can also infer the current KB and locale from the docs page that triggered the request

This keeps retrieval scoped to the active documentation set when possible.

Setup

The TockDocs MCP server uses HTTP transport and can be connected to multiple assistants.

Claude Code

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

Cursor

Install in Cursor

Or manually create/update .cursor/mcp.json:

.cursor/mcp.json
{
  "mcpServers": {
    "my-docs": {
      "type": "http",
      "url": "https://docs.example.com/mcp"
    }
  }
}

Visual Studio Code

Install in VS Code

Or manually create/update .vscode/mcp.json:

.vscode/mcp.json
{
  "servers": {
    "my-docs": {
      "type": "http",
      "url": "https://docs.example.com/mcp"
    }
  }
}

Windsurf

.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "my-docs": {
      "type": "http",
      "url": "https://docs.example.com/mcp"
    }
  }
}

Zed

.config/zed/settings.json
{
  "context_servers": {
    "my-docs": {
      "source": "custom",
      "command": "npx",
      "args": ["mcp-remote", "https://docs.example.com/mcp"],
      "env": {}
    }
  }
}

Customization

TockDocs uses @nuxtjs/mcp-toolkit, so you can extend the MCP server with custom tools, resources, prompts, and handlers.

Add custom tools

server/mcp/tools/search.ts
import { z } from 'zod'

export default defineMcpTool({
  description: 'Search documentation by keyword',
  inputSchema: {
    query: z.string().describe('The search query'),
  },
  handler: async ({ query }) => {
    const results = await searchDocs(query)
    return {
      content: [{ type: 'text', text: JSON.stringify(results) }],
    }
  },
})

Add resources

server/mcp/resources/changelog.ts
export default defineMcpResource({
  file: 'CHANGELOG.md',
  metadata: {
    description: 'Project changelog',
  },
})

Add prompts

server/mcp/prompts/migration-help.ts
import { z } from 'zod'

export default defineMcpPrompt({
  description: 'Get help with migrating between versions',
  inputSchema: {
    fromVersion: z.string().describe('Current version'),
    toVersion: z.string().describe('Target version'),
  },
  handler: async ({ fromVersion, toVersion }) => {
    return {
      messages: [
        {
          role: 'user',
          content: {
            type: 'text',
            text: `Help me migrate from version ${fromVersion} to ${toVersion}. What changed?`,
          },
        },
      ],
    }
  },
})

Add separate handlers

You can expose different MCP endpoints with their own tool sets.

server/mcp/migration.ts
import { z } from 'zod'

const migrationTool = defineMcpTool({
  name: 'migrate-v3-to-v4',
  description: 'Migrate code from version 3 to version 4',
  inputSchema: {
    code: z.string().describe('The code to migrate'),
  },
  handler: async ({ code }) => {
    return {
      content: [{ type: 'text', text: code }],
    }
  },
})

export default defineMcpHandler({
  route: '/mcp/migration',
  name: 'Migration Assistant',
  version: '1.0.0',
  tools: [migrationTool],
})
See the @nuxtjs/mcp-toolkit docs for the full API surface.
Copyright © 2026