# 将 Mintlify Index 连接到你的编码代理 (/zh/search-index/connect)

<!-- agent-signals: reading_time_min: 5 · est_tokens: 2906 · updated: 2026-09-23 -->
Related: [Mintlify Index MCP 服务器](/zh/search-index/mcp.md), [skill.md](/zh/ai/skillmd.md)

将你的编码代理连接到 Mintlify Index，使其可以在规划和编写代码时检索最新的技术文档和 Web 上下文。Index 支持 Claude Code、Cursor、VS Code、Codex、OpenCode、Windsurf 和 Zed。

<Info>
  连接公开的 Index MCP 服务器不需要 Mintlify 账户或 API key。
</Info>

<div id="set-up-with-the-cli">
  ## 使用 CLI 设置 [#使用-cli-设置]
</div>

运行 Index 设置命令，即可在一个步骤中配置一个或多个编码代理：

```bash
npx mint index
```

该命令会检测已安装的受支持编码代理，并提示你选择要配置的代理。对于每个选中的代理，它会将 Index MCP 服务器添加到该代理的配置中，并安装一条规则，告诉代理何时使用 `context` 工具。

要跳过选择器，请改为传入一个或多个代理标志：

```bash
npx mint index --claude --cursor
```

| 标志           | 编码代理        |
| ------------ | ----------- |
| `--claude`   | Claude Code |
| `--cursor`   | Cursor      |
| `--vscode`   | VS Code     |
| `--codex`    | Codex       |
| `--opencode` | OpenCode    |
| `--windsurf` | Windsurf    |
| `--zed`      | Zed         |

<Tip>
  添加 `--yes` 可在不提示的情况下配置检测到的所有代理，或添加 `--project` 将配置写入当前项目，而不是全局代理设置。并非所有代理都支持项目级配置；这些代理始终会接收全局配置。
</Tip>

再次运行该命令即可更新现有设置或添加其他代理。

<div id="set-up-manually">
  ## 手动设置 [#手动设置]
</div>

要手动配置某个代理，或确认 CLI 所做的更改，请按照对应代理的步骤操作。

<Tabs>
  <Tab title="Claude Code" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M4.00004 17C4.00004 17 9.99999 12.5811 10 11C10 9.41884 4 5 4 5&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M12 19H20&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>">
    <Steps>
      <Step title="添加服务器">
        运行以下命令：

        ```bash
        claude mcp add --transport http mintlify-index https://index.mintlify.com/mcp
        ```
      </Step>

      <Step title="验证连接">
        列出已配置的 MCP 服务器：

        ```bash
        claude mcp list
        ```

        输出应包含状态为已连接的 `mintlify-index`。
      </Step>
    </Steps>
  </Tab>

  <Tab title="Cursor" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M9.80282 4.62973L15.8364 6.99069C19.3164 8.35243 21.0564 9.03329 20.9987 10.1133C20.941 11.1934 19.1251 11.6886 15.4933 12.6791C14.412 12.974 13.8713 13.1215 13.4964 13.4963C13.1215 13.8712 12.9741 14.4119 12.6791 15.4933C11.6887 19.125 11.1934 20.9409 10.1134 20.9986C9.03335 21.0563 8.35249 19.3163 6.99075 15.8363L4.62979 9.80276C3.20411 6.15934 2.49127 4.33764 3.41448 3.41442C4.3377 2.49121 6.15941 3.20405 9.80282 4.62973Z&#x22; stroke=&#x22;currentColor&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>">
    选择**在 Cursor 中安装**，检查 MCP 配置，然后批准安装。

    <PreviewButton href="cursor://anysphere.cursor-deeplink/mcp/install?name=mintlify-index&config=eyJ1cmwiOiJodHRwczovL2luZGV4Lm1pbnRsaWZ5LmNvbS9tY3AifQ">
      在 Cursor 中安装
    </PreviewButton>

    也可以手动配置 Cursor：

    <Steps>
      <Step title="打开 MCP 设置">
        1. 使用 <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>（Windows 上为 <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>）打开命令面板。
        2. 搜索**打开 MCP 设置**。
        3. 选择**添加自定义 MCP**，打开 `mcp.json`。
      </Step>

      <Step title="添加 Mintlify Index">
        添加以下服务器：

        ```json
        {
          "mcpServers": {
            "mintlify-index": {
              "url": "https://index.mintlify.com/mcp"
            }
          }
        }
        ```
      </Step>

      <Step title="验证连接">
        重新加载 Cursor，然后打开 **Settings → Tools & MCP**（设置 → 工具和 MCP）。`mintlify-index` 服务器应显示为已连接，并且可以使用 `context` 工具。
      </Step>
    </Steps>
  </Tab>

  <Tab title="VS Code" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M16 6.99998L19.0664 9.64296C20.3554 10.7541 21 11.3096 21 12C21 12.6903 20.3555 13.2459 19.0664 14.357L16 17&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M8 6.99998L4.93365 9.64296C3.64455 10.7541 3 11.3096 3 12C3 12.6903 3.64455 13.2459 4.93365 14.357L8 17&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>">
    将以下服务器添加到 VS Code 用户配置文件夹中的 `mcp.json`，或添加到项目中的 `.vscode/mcp.json`：

    ```json
    {
      "servers": {
        "mintlify-index": {
          "type": "http",
          "url": "https://index.mintlify.com/mcp"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Codex" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M9.5 9.5L7.96682 10.8215C7.32228 11.377 7 11.6548 7 12C7 12.3452 7.32227 12.623 7.96682 13.1785L9.5 14.5&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M14.5 9.5L16.0332 10.8215C16.6777 11.377 17 11.6548 17 12C17 12.3452 16.6777 12.623 16.0332 13.1785L14.5 14.5&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>">
    将以下服务器添加到 `~/.codex/config.toml`，或添加到项目中的 `.codex/config.toml`：

    ```toml
    [mcp_servers.mintlify-index]
    type = "http"
    url = "https://index.mintlify.com/mcp"
    ```
  </Tab>

  <Tab title="OpenCode" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M8 3C7.5355 3 7.30325 3 7.10891 3.03078C6.03918 3.20021 5.20021 4.03918 5.03078 5.10891C5 5.30325 5 5.5355 5 6L5 10C5 11.1046 4.10457 12 3 12C4.10406 11.9982 5 12.8928 5 13.9968V18C5 18.4645 5 18.6968 5.03078 18.8911C5.20021 19.9608 6.03918 20.7998 7.10891 20.9692C7.30325 21 7.5355 21 8 21&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M16 3C16.4645 3 16.6968 3 16.8911 3.03078C17.9608 3.20021 18.7998 4.03918 18.9692 5.10891C19 5.30325 19 5.5355 19 6L19 10C19 11.1046 19.8954 12 21 12C19.8959 11.9982 19 12.8928 19 13.9968V18C19 18.4645 19 18.6968 18.9692 18.8911C18.7998 19.9608 17.9608 20.7998 16.8911 20.9692C16.6968 21 16.4645 21 16 21&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>">
    将以下服务器添加到 `~/.config/opencode/opencode.json`，或添加到项目中的 `opencode.json`：

    ```json
    {
      "mcp": {
        "mintlify-index": {
          "type": "remote",
          "url": "https://index.mintlify.com/mcp",
          "enabled": true
        }
      }
    }
    ```
  </Tab>

  <Tab title="Windsurf" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M2 5.94145C5.5 9.37313 10.5755 7.90241 11.7324 5.94145C11.9026 5.65301 12 5.31814 12 4.96096C12 3.87795 11.1046 3 10 3C8.89543 3 8 3.87795 8 4.96096&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M17 8.92814C17 7.31097 18.1193 6 19.5 6C20.8807 6 22 7.31097 22 8.92814C22 9.6452 21.7799 10.3021 21.4146 10.8111C19.3463 14.1915 9.2764 12.9164 4 11.8563&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M13.0854 19.8873C13.2913 20.5356 13.8469 21 14.5 21C15.3284 21 16 20.2528 16 19.331C16 19.0176 15.9224 18.7244 15.7873 18.4738C14.4999 15.9925 7.99996 14.3239 2 18.7746&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M19 15.5H21&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>">
    将以下服务器添加到 `~/.codeium/windsurf/mcp_config.json`。Windsurf 不支持项目级 MCP 配置。

    ```json
    {
      "mcpServers": {
        "mintlify-index": {
          "serverUrl": "https://index.mintlify.com/mcp"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Zed" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M8.62814 12.6736H8.16918C6.68545 12.6736 5.94358 12.6736 5.62736 12.1844C5.31114 11.6953 5.61244 11.0138 6.21504 9.65083L8.02668 5.55323C8.57457 4.314 8.84852 3.69438 9.37997 3.34719C9.91142 3 10.5859 3 11.935 3H14.0244C15.6632 3 16.4826 3 16.7916 3.53535C17.1007 4.0707 16.6942 4.78588 15.8811 6.21623L14.8092 8.10188C14.405 8.81295 14.2029 9.16849 14.2057 9.45952C14.2094 9.83775 14.4105 10.1862 14.7354 10.377C14.9854 10.5239 15.3927 10.5239 16.2074 10.5239C17.2373 10.5239 17.7523 10.5239 18.0205 10.7022C18.3689 10.9338 18.5513 11.3482 18.4874 11.7632C18.4382 12.0826 18.0918 12.4656 17.399 13.2317L11.8639 19.3523C10.7767 20.5545 10.2331 21.1556 9.86807 20.9654C9.50303 20.7751 9.67833 19.9822 10.0289 18.3962L10.7157 15.2896C10.9826 14.082 11.1161 13.4782 10.7951 13.0759C10.4741 12.6736 9.85877 12.6736 8.62814 12.6736Z&#x22; stroke=&#x22;currentColor&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>">
    将以下服务器添加到你的 Zed `settings.json`，或添加到项目中的 `.zed/settings.json`：

    ```json
    {
      "context_servers": {
        "mintlify-index": {
          "url": "https://index.mintlify.com/mcp"
        }
      }
    }
    ```
  </Tab>
</Tabs>

<div id="use-index-in-a-session">
  ## 在会话中使用 Index [#在会话中使用-index]
</div>

提出实现问题，并告诉代理在你希望确保它检索最新来源时使用 Index。例如：

```text
Use Mintlify Index to find the current recommended way to configure caching in Next.js 16. Cite the sources you use.
```

代理在需要技术上下文时会调用 Index 的 `context` 工具，并在工作中包含返回的来源链接。

<div id="remove-the-connection">
  ## 移除连接 [#移除连接]
</div>

<Tabs>
  <Tab title="Claude Code" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M4.00004 17C4.00004 17 9.99999 12.5811 10 11C10 9.41884 4 5 4 5&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M12 19H20&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>">
    运行以下命令：

    ```bash
    claude mcp remove mintlify-index
    ```
  </Tab>

  <Tab title="Cursor" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M9.80282 4.62973L15.8364 6.99069C19.3164 8.35243 21.0564 9.03329 20.9987 10.1133C20.941 11.1934 19.1251 11.6886 15.4933 12.6791C14.412 12.974 13.8713 13.1215 13.4964 13.4963C13.1215 13.8712 12.9741 14.4119 12.6791 15.4933C11.6887 19.125 11.1934 20.9409 10.1134 20.9986C9.03335 21.0563 8.35249 19.3163 6.99075 15.8363L4.62979 9.80276C3.20411 6.15934 2.49127 4.33764 3.41448 3.41442C4.3377 2.49121 6.15941 3.20405 9.80282 4.62973Z&#x22; stroke=&#x22;currentColor&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>">
    打开 **Settings → Tools & MCP**（设置 → 工具和 MCP），然后从 `mcp.json` 中删除 `mintlify-index` 条目。
  </Tab>
</Tabs>

对于 VS Code、Codex、OpenCode、Windsurf 或 Zed，请从该代理的 MCP 服务器配置中删除 `mintlify-index` 条目。

有关工具输入和速率限制，请参阅 [Index MCP 参考](/zh/search-index/mcp)。
