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.
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:
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.
| Parameter | Type | Description |
|---|---|---|
query | string (required) | Search query or natural-language question |
limit | number (optional) | Maximum number of results to return |
kb | string (optional) | Knowledge base id to scope results in multi-KB sites |
locale | string (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.
| Parameter | Type | Description |
|---|---|---|
kb | string (optional) | Knowledge base id to scope results in multi-KB sites |
locale | string (optional) | Locale code to scope results |
get-page
Retrieves the full markdown content of a specific documentation page.
| Parameter | Type | Description |
|---|---|---|
path | string (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
kbandlocaleexplicitly tosearch-pagesandlist-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
Or manually create/update .cursor/mcp.json:
{
"mcpServers": {
"my-docs": {
"type": "http",
"url": "https://docs.example.com/mcp"
}
}
}
Visual Studio Code
Or manually create/update .vscode/mcp.json:
{
"servers": {
"my-docs": {
"type": "http",
"url": "https://docs.example.com/mcp"
}
}
}
Windsurf
{
"mcpServers": {
"my-docs": {
"type": "http",
"url": "https://docs.example.com/mcp"
}
}
}
Zed
{
"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
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
export default defineMcpResource({
file: 'CHANGELOG.md',
metadata: {
description: 'Project changelog',
},
})
Add prompts
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.
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],
})