---
title: "MCP Server"
description: "Connect your documentation to AI tools with a native MCP server."
canonical_url: "https://docus.dev/en/ai/mcp"
---
# MCP Server

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

## About MCP Servers

The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open protocol that creates standardized connections between AI applications and external services, like documentation.

Every Docus instance includes a built-in MCP server, preparing your content for the broader AI ecosystem where any MCP client (like Claude, Cursor, VS Code, and others) can connect to your documentation.

### How MCP Servers Work

When an MCP server is connected to an AI tool, the LLM can decide to use your documentation tools during response generation:

- The LLM can **proactively search your documentation** while generating a response, not just when explicitly asked.
- The LLM determines **when to use tools** based on the context of the conversation and the relevance of your documentation.
- Each tool call happens **during the generation process**, allowing the LLM to incorporate real-time information from your documentation into its response.

For example, if a user asks a coding question and the LLM determines that your documentation is relevant, it can search your docs and include that information in the response without the user explicitly asking about your documentation.

## Accessing Your MCP Server

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

<note>

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

</note>

<note>

The MCP server is documented in your [`llms.txt`](https://docus.dev/en/ai/llms) as an `MCP Server` section. An agent that discovers your site through `llms.txt` can connect without anyone pasting the URL into a client configuration.

</note>

<note>

Your site also publishes an MCP server card at `/.well-known/mcp/server-card.json`. It lists the endpoint and the tools, resources and prompts the server exposes, so an agent can find the server without reading the docs.

</note>

## Disable the MCP Server

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

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

## Built-in Tools

Docus provides two tools out of the box that allow any LLM to discover and read your documentation:

### `list-pages`

Lists all documentation pages with their titles, paths, and descriptions. AI assistants should call this first to discover available content.

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        locale
      </code>
    </td>
    
    <td>
      string (optional)
    </td>
    
    <td>
      Filter pages by locale
    </td>
  </tr>
</tbody>
</table>

### `get-page`

Retrieves the full markdown content of a specific documentation page.

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        path
      </code>
    </td>
    
    <td>
      string (required)
    </td>
    
    <td>
      The page path (e.g., <code>
        /en/getting-started/installation
      </code>
      
      )
    </td>
  </tr>
</tbody>
</table>

## Setup

The Docus MCP server uses HTTP transport and can be installed in different AI assistants.

### Claude Code

Add the server using the CLI command:

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

### Cursor

<install-button ide="cursor" label="Install in Cursor" url="https://docs.example.com/mcp">



</install-button>

Or manually create/update `.cursor/mcp.json` in your project root:

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

### Visual Studio Code

Ensure you have GitHub Copilot and GitHub Copilot Chat extensions installed.

<install-button ide="vscode" label="Install in VS Code" url="https://docs.example.com/mcp">



</install-button>

Or manually create/update the `.vscode/mcp.json` file:

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

### Windsurf

1. Open Windsurf and navigate to **Settings** > **Windsurf Settings** > **Cascade**
2. Click the **Manage MCPs** button, then select the **View raw config** option
3. Add the following configuration:

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

### Zed

1. Open Zed and go to **Settings** > **Open Settings**
2. Navigate to the JSON settings file
3. Add the following context server configuration:

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

## Customization

Since Docus uses the `@nuxtjs/mcp-toolkit` module, you can extend the MCP server with custom tools, resources, prompts, and handlers.

### Adding Custom Tools

Create new tools in the `server/mcp/tools/` directory:

```ts [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) }],
    }
  },
})
```

### Adding Resources

Expose files or data sources as MCP resources in the `server/mcp/resources/` directory. The simplest way is using the `file` property:

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

This automatically handles URI generation, MIME type detection, and file reading.

### Adding Prompts

Create reusable prompts for AI assistants in the `server/mcp/prompts/` directory:

```ts [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 are the breaking changes and steps I need to follow?`,
        },
      }],
    }
  },
})
```

### Adding Custom Handlers

Handlers allow you to create separate MCP endpoints with their own tools, resources, and prompts. This is useful for exposing different capabilities at different routes.

For example, you could have:

- `/mcp` - Main documentation MCP server
- `/mcp/migration` - Dedicated MCP server for migration assistance

```ts [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 }) => {
    // Migration logic
    return {
      content: [{ type: 'text', text: migratedCode }],
    }
  },
})

export default defineMcpHandler({
  route: '/mcp/migration',
  name: 'Migration Assistant',
  version: '1.0.0',
  tools: [migrationTool],
})
```

### Overwriting Built-in Tools

You can override the default `list-pages` or `get-page` tools by creating a tool with the same name in your project:

```ts [server/mcp/tools/list-pages.ts]
import { z } from 'zod'

export default defineMcpTool({
  description: 'Custom list pages implementation',
  inputSchema: {
    locale: z.string().optional(),
    category: z.string().optional(),
  },
  handler: async ({ locale, category }) => {
    const pages = await getCustomPageList(locale, category)
    return {
      content: [{ type: 'text', text: JSON.stringify(pages) }],
    }
  },
})
```

<tip to="https://mcp-toolkit.nuxt.dev/">

Check the MCP Toolkit documentation for more information about tools, resources, prompts, handlers and advanced configuration.

</tip>


## Sitemap

See the full [sitemap](https://docus.dev/sitemap.md) for all pages.
