# Source: https://www.mintlify.com/docs/ai/model-context-protocol.md

> ## Documentation Index
> Fetch the complete documentation index at: https://www.mintlify.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Model Context Protocol

> Connect your documentation and API endpoints to AI tools with a hosted MCP server.

export const PreviewButton = ({children, href}) => {
  return <a href={href} className="text-sm font-medium text-white dark:!text-zinc-950 bg-zinc-900 hover:bg-zinc-700 dark:bg-zinc-100 hover:dark:bg-zinc-300 rounded-full px-3.5 py-1.5 not-prose">
        {children}
      </a>;
};

## About MCP servers

The Model Context Protocol (MCP) is an open protocol that creates standardized connections between AI applications and external services, like documentation. Mintlify generates an MCP server from your documentation, preparing your content for the broader AI ecosystem where any MCP client like Claude, Cursor, Goose, ChatGPT, and others can connect to your documentation.

Your MCP server exposes a search tool for AI applications to query your documentation. Your users must connect your MCP server to their tools.

### How MCP servers work

When an AI application connects to your documentation MCP server, it can search your documentation directly instead of making a generic web search in response to a user's prompt. Your MCP server provides access to all indexed content on your documentation site.

* The AI application can proactively search your documentation while generating a response, not just when explicitly asked.
* The AI application determines when to use the search tool based on the context of the conversation and the relevance of your documentation.
* Each search (tool call) happens during the generation process, so the AI application searches up-to-date information from your documentation to generate its response.

<Tip>
  Some AI tools like Claude support both MCP and Skills. MCP gives the AI access to your documentation content, while Skills instruct the AI how to use that content effectively. They're complementary. MCP provides the data and Skills provide the instructions.
</Tip>

### Search filtering parameters

The MCP search tool supports optional filtering parameters that AI applications can use to narrow search results.

* **`version`**: Filter results to a specific documentation version. For example, `'v0.7'`. Only returns content tagged with the specified version or content available across all versions.
* **`language`**: Filter results to a specific language code. For example, `'en'`, `'zh'`, or `'es'`. Only returns content in the specified language or content available across all languages.
* **`apiReferenceOnly`**: When set to `true`, only returns API reference documentation pages.
* **`codeOnly`**: When set to `true`, only returns code snippets and examples.

AI applications determine when to apply these filters based on the context of the user's query. For example, if a user asks about a specific API version or requests code examples, the AI application may automatically apply the appropriate filters to provide more relevant results.

### MCP compared to web search

AI tools can search the web, but MCP provides distinct advantages for documentation.

* **Direct source access**: Web search depends on what search engines have indexed, which may be stale or incomplete. MCP searches your current indexed documentation directly.
* **Integrated workflow**: MCP allows the AI to search during response generation rather than performing a separate web search.
* **No search noise**: SEO and ranking algorithms influence web search results. MCP goes straight to your documentation content.

## Access your MCP server

<Note>
  MCP servers are only available for public documentation. Documentation behind end-user authentication cannot generate an MCP server.
</Note>

Mintlify automatically generates an MCP server for your documentation and hosts it at your documentation URL with the `/mcp` path. For example, Mintlify's MCP server is available at `https://mintlify.com/docs/mcp`.

View and copy your MCP server URL on the [MCP server page](https://dashboard.mintlify.com/products/mcp) in your dashboard.

<Frame>
  <img src="https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-light.png?fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=fe99ba970692e913694abeda27db201f" alt="MCP server page in the dashboard." className="block dark:hidden" data-og-width="2066" width="2066" data-og-height="972" height="972" data-path="images/mcp/mcp-server-page-light.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-light.png?w=280&fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=b95d116fb0deb4a8b1501a1600c8af56 280w, https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-light.png?w=560&fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=e20ecc55e13447b4f89477c0d83e420a 560w, https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-light.png?w=840&fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=400cfd653555303e7cfc12cc62d293f5 840w, https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-light.png?w=1100&fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=0183c7ca768576d3cfa6f1b5328148d6 1100w, https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-light.png?w=1650&fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=2a5ac421d21b6eb3309cf51b4593098b 1650w, https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-light.png?w=2500&fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=0bb46e2c4bf2b9de40cb2b8795e53282 2500w" />

  <img src="https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-dark.png?fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=81739348dcafa3573ecc588a8ca38fbe" alt="MCP server page in the dashboard." className="hidden dark:block" data-og-width="2068" width="2068" data-og-height="974" height="974" data-path="images/mcp/mcp-server-page-dark.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-dark.png?w=280&fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=b1ce166a28e15b58b7d2aa9f0f59d1ee 280w, https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-dark.png?w=560&fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=d331efc54fb79f407c27bb91ef9c41ee 560w, https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-dark.png?w=840&fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=ce0728b8e7a3dbff1c42787a8aafeb97 840w, https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-dark.png?w=1100&fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=ad0e7fbb386ea294d5e2970882778687 1100w, https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-dark.png?w=1650&fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=20bf80ca67cc899ffabeeee7bb21112f 1650w, https://mintcdn.com/mintlify/l_uyIoyoCoduAB2a/images/mcp/mcp-server-page-dark.png?w=2500&fit=max&auto=format&n=l_uyIoyoCoduAB2a&q=85&s=4d32e173f7ce6ccedbbc62e2af0c9519 2500w" />
</Frame>

<Note>
  Hosted MCP servers use the `/mcp` path in their URLs. Other navigation elements cannot use the `/mcp` path.
</Note>

## Content filtering and indexing

Your MCP server searches content that Mintlify indexes from your documentation repository. File processing and search indexing control what content is available through your MCP server.

### File processing with `.mintignore`

If files match [.mintignore](/organize/mintignore) patterns, Mintlify does not process or index them. These files are not available through your MCP server.

### Search indexing with `docs.json`

By default, Mintlify only indexes pages included in your `docs.json` navigation for search through your MCP server.

Mintlify excludes [hidden pages](/organize/hidden-pages) (pages not in your navigation) from the search index unless you choose to index all pages. To include hidden pages in your MCP server's search results, add the `seo.indexing` property to your `docs.json`.

```json  theme={null}
"seo": {
    "indexing": "all"
}
```

To exclude a specific page from search indexing, add `noindex: true` to its frontmatter.

```mdx  theme={null}
---
title: "Hidden page"
description: "This page is not in the navigation and is not available through search."
noindex: true
---
```

## Use your MCP server

Your users must connect your MCP server to their preferred AI tools.

1. Make your MCP server URL publicly available.
2. Users copy your MCP server URL and add it to their tools.
3. Users access your documentation through their tools.

These are some of the ways you can help your users connect to your MCP server:

<Tabs>
  <Tab title="Contextual menu">
    Add options in the [contextual menu](/ai/contextual-menu) for your users to connect to your MCP server from any page of your documentation.

    | Option                  | Identifier | Description                                         |
    | :---------------------- | :--------- | :-------------------------------------------------- |
    | **Copy MCP server URL** | `mcp`      | Copies your MCP server URL to the user's clipboard. |
    | **Connect to Cursor**   | `cursor`   | Installs your MCP server in Cursor.                 |
    | **Connect to VS Code**  | `vscode`   | Installs your MCP server in VS Code.                |
  </Tab>

  <Tab title="Claude">
    <Steps>
      <Step title="Get your MCP server URL.">
        Navigate to your [dashboard](https://dashboard.mintlify.com/products/mcp) and find your MCP server URL.
      </Step>

      <Step title="Publish your MCP server URL for your users.">
        Create a guide for your users that includes your MCP server URL and the steps to connect it to Claude.

        1. Navigate to the [Connectors](https://claude.ai/settings/connectors) page in the Claude settings.
        2. Select **Add custom connector**.
        3. Add your MCP server name and URL.
        4. Select **Add**.
        5. When using Claude, select the attachments button (the plus icon).
        6. Select your MCP server.
      </Step>
    </Steps>

    See the [Model Context Protocol documentation](https://modelcontextprotocol.io/docs/tutorials/use-remote-mcp-server#connecting-to-a-remote-mcp-server) for more details.
  </Tab>

  <Tab title="Claude Code">
    <Steps>
      <Step title="Get your MCP server URL.">
        Navigate to your [dashboard](https://dashboard.mintlify.com/products/mcp) and find your MCP server URL.
      </Step>

      <Step title="Publish your MCP server URL for your users.">
        Create a guide for your users that includes your MCP server URL and the command to connect it to Claude Code.

        ```bash  theme={null}
        claude mcp add --transport http <name> <url>
        ```
      </Step>
    </Steps>

    See the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code/mcp#installing-mcp-servers) for more details.
  </Tab>

  <Tab title="Cursor">
    <Steps>
      <Step title="Get your MCP server URL.">
        Navigate to your [dashboard](https://dashboard.mintlify.com/products/mcp) and find your MCP server URL.
      </Step>

      <Step title="Publish your MCP server URL for your users.">
        Create a guide for your users that includes your MCP server URL and the steps to connect it to Cursor.

        1. Use <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> on Windows) to open the command palette.
        2. Search for "Open MCP settings".
        3. Select **Add custom MCP**. This opens the `mcp.json` file.
        4. In `mcp.json`, configure your server:

        ```json  theme={null}
        {
          "mcpServers": {
            "<your-mcp-server-name>": {
              "url": "<your-mcp-server-url>"
            }
          }
        }
        ```
      </Step>
    </Steps>

    See the [Cursor documentation](https://docs.cursor.com/en/context/mcp#installing-mcp-servers) for more details.
  </Tab>

  <Tab title="VS Code">
    <Steps>
      <Step title="Get your MCP server URL.">
        Navigate to your [dashboard](https://dashboard.mintlify.com/products/mcp) and find your MCP server URL.
      </Step>

      <Step title="Publish your MCP server URL for your users.">
        Create a guide for your users that includes your MCP server URL and the steps to connect it to VS Code.

        1. Create a `.vscode/mcp.json` file.
        2. In `mcp.json`, configure your server:

        ```json  theme={null}
        {
          "servers": {
            "<your-mcp-server-name>": {
              "type": "http",
              "url": "<your-mcp-server-url>"
            }
          }
        }
        ```
      </Step>
    </Steps>

    See the [VS Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more details.
  </Tab>
</Tabs>

### Example: Connect to the Mintlify MCP server

Connect to the Mintlify MCP server to search this documentation site within your preferred AI tool. This gives you more accurate answers about how to use Mintlify in your local environment and demonstrates how you can help your users connect to your MCP server.

<Tabs>
  <Tab title="Contextual menu">
    At the top of this page, select the contextual menu and choose **Connect to Cursor** or **Connect to VS Code** to connect the Mintlify MCP server to the IDE of your choice.
  </Tab>

  <Tab title="Claude">
    To use the Mintlify MCP server with Claude:

    <Steps>
      <Step title="Add the Mintlify MCP server to Claude">
        1. Navigate to the [Connectors](https://claude.ai/settings/connectors) page in the Claude settings.
        2. Select **Add custom connector**.
        3. Add the Mintlify MCP server:

        * Name: `Mintlify`
        * URL: `https://mintlify.com/docs/mcp`

        4. Select **Add**.
      </Step>

      <Step title="Access the MCP server in your chat">
        1. When using Claude, select the attachments button (the plus icon).
        2. Select the Mintlify MCP server.
        3. Ask Claude a question about Mintlify.
      </Step>
    </Steps>

    See the [Model Context Protocol documentation](https://modelcontextprotocol.io/docs/tutorials/use-remote-mcp-server#connecting-to-a-remote-mcp-server) for more details.
  </Tab>

  <Tab title="Claude Code">
    To use the Mintlify MCP server with Claude Code, run the following command:

    ```bash  theme={null}
    claude mcp add --transport http Mintlify https://mintlify.com/docs/mcp
    ```

    Test the connection by running:

    ```bash  theme={null}
    claude mcp list
    ```

    See the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code/mcp#installing-mcp-servers) for more details.
  </Tab>

  <Tab title="Cursor">
    <PreviewButton href="cursor://anysphere.cursor-deeplink/mcp/install?name=mintlify&config=eyJ1cmwiOiJodHRwczovL21pbnRsaWZ5LmNvbS9kb2NzL21jcCJ9">Install in Cursor</PreviewButton>

    To connect the Mintlify MCP server to Cursor, click the **Install in Cursor** button. Or to manually connect the MCP server, follow these steps:

    <Steps>
      <Step title="Open MCP settings">
        1. Use <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> on Windows) to open the command palette.
        2. Search for "Open MCP settings".
        3. Select **Add custom MCP**. This opens the `mcp.json` file.
      </Step>

      <Step title="Configure the Mintlify MCP server">
        In `mcp.json`, add:

        ```json  theme={null}
        {
          "mcpServers": {
            "Mintlify": {
              "url": "https://mintlify.com/docs/mcp"
            }
          }
        }
        ```
      </Step>

      <Step title="Test the connection">
        In Cursor's chat, ask "What tools do you have available?" Cursor should show the Mintlify MCP server as an available tool.
      </Step>
    </Steps>

    See [Installing MCP servers](https://docs.cursor.com/en/context/mcp#installing-mcp-servers) in the Cursor documentation for more details.
  </Tab>

  <Tab title="VS Code">
    <PreviewButton href="https://vscode.dev/redirect/mcp/install?name=mintlify&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmintlify.com%2Fdocs%2Fmcp%22%7D">Install in VS Code</PreviewButton>

    To connect the Mintlify MCP server to VS Code, click the **Install in VS Code** button. Or to manually connect the MCP server, create a `.vscode/mcp.json` file and add:

    ```json  theme={null}
    {
      "servers": {
        "Mintlify": {
          "type": "http",
          "url": "https://mintlify.com/docs/mcp"
        }
      }
    }
    ```

    See the [VS Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more details.
  </Tab>
</Tabs>

### Using multiple MCP servers

Users can connect multiple MCP servers to their AI tools. Connected MCP servers do not consume context until the AI calls a search tool. The AI decides when to search based on query relevance, so it doesn't search every connected server for every question.

When the AI searches, each query returns multiple results that add to the conversation's context. If the AI searches several servers for a single question, this can use up significant context.

Best practices for using multiple MCP servers:

* Connect only the MCP servers relevant to your current work.
* Be specific in your prompts so the AI searches the most relevant server.
* Disconnect servers you're not actively using to reduce potential context usage.