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

# 为 Cursor、Claude、Windsurf 等编辑器设置 MCP

> 通过 MCP 将 Cursor、Claude、Windsurf 和其他编辑器连接到 InsForge，让 AI 智能体可以查询你的数据库、身份验证、存储和函数。

## 概述

InsForge MCP 服务器让你的 AI 编程助手可以直接访问你的后端：数据库查询、模式管理、存储等。

请按照以下针对你的 AI 客户端的说明进行操作。没有看到你的工具？浏览[智能体目录](https://insforge.dev/agents)查看完整的已测试集成列表。

## 前提条件

* 一个 **AI 编程助手**（Cursor、Claude Code、GitHub Copilot 等）
* 一个 **InsForge 项目** - 如果还没有，[点此创建](https://insforge.dev)

## 本地 MCP 配置（推荐）

如果你更喜欢在本地配置 MCP，请在下方选择你的 AI 编程助手：

<AccordionGroup>
  <Accordion title="Cursor">
    ### 安装

    你可以在 Cursor 中点击下方截图里的 "Add to Cursor" 按钮，一键安装 MCP 服务器：

    <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/connect-project.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=4ef0e69172a5b685170cea8adec6b0c3" alt="连接项目" width="1246" height="1434" data-path="images/mcp-setup/connect-project.png" />

    或者，你也可以手动安装 InsForge MCP 服务器：

    1. 打开 **Cursor Settings**
    2. 进入 **Tools & MCP**
    3. 点击 **New MCP Server (Add a Custom MCP Server)**

    <Frame>
      <video src="https://mintcdn.com/insforge-468ccf39/ioq-HbhhvPKTChxw/images/mcp-setup/Cursor-MCP-1.mp4?fit=max&auto=format&n=ioq-HbhhvPKTChxw&q=85&s=ec15b20e709d8536d3d09666e89364e7" autoPlay muted loop playsInline data-path="images/mcp-setup/Cursor-MCP-1.mp4" />
    </Frame>

    4. 粘贴来自你 InsForge 项目的 MCP JSON
    5. 保存配置文件
    6. 你应该会看到一个绿点，表示 InsForge 已成功安装

    <Frame>
      <video src="https://mintcdn.com/insforge-468ccf39/ioq-HbhhvPKTChxw/images/mcp-setup/Cursor-MCP-2.mp4?fit=max&auto=format&n=ioq-HbhhvPKTChxw&q=85&s=177e1e5dbdc0cdfbd8248f8d442722e5" autoPlay muted loop playsInline data-path="images/mcp-setup/Cursor-MCP-2.mp4" />
    </Frame>

    ### 验证安装

    要验证连接，请在 **Cursor** 中开始一个新的聊天会话，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **Connected** 状态指示。

    <video controls autoPlay muted loop playsInline width="100%" src="https://mintcdn.com/insforge-468ccf39/ioq-HbhhvPKTChxw/images/mcp-setup/Cursor-MCP-3.mp4?fit=max&auto=format&n=ioq-HbhhvPKTChxw&q=85&s=bf99a7adcb00c864413df17464d9794b" data-path="images/mcp-setup/Cursor-MCP-3.mp4" />
  </Accordion>

  <Accordion title="Claude Code">
    ### 安装

    将 InsForge MCP 服务器添加到你的 **Claude Code**：

    1. 在下拉列表中选择 **Claude Code**

    2. 复制以下安装命令并粘贴到你的终端中

           <img src="https://mintcdn.com/insforge-468ccf39/fNI11NfWIUSxQDZ4/images/mcp-setup/claude-code-connect.png?fit=max&auto=format&n=fNI11NfWIUSxQDZ4&q=85&s=f4710fd707714996fd26934458e5b841" alt="Claude Code 连接" width="637" height="728" data-path="images/mcp-setup/claude-code-connect.png" />

    3. 运行该命令

    <Frame>
      <video src="https://mintcdn.com/insforge-468ccf39/ioq-HbhhvPKTChxw/images/mcp-setup/CC-MCP-1.mp4?fit=max&auto=format&n=ioq-HbhhvPKTChxw&q=85&s=1ce35e7b4049008f1be4b5a2b069956d" autoPlay muted loop playsInline data-path="images/mcp-setup/CC-MCP-1.mp4" />
    </Frame>

    ### 验证安装

    要验证连接，请在 **Claude Code** 中开始一个新的聊天会话，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

    <video controls autoPlay muted loop playsInline width="100%" src="https://mintcdn.com/insforge-468ccf39/ioq-HbhhvPKTChxw/images/mcp-setup/CC-MCP-2.mp4?fit=max&auto=format&n=ioq-HbhhvPKTChxw&q=85&s=2853f145fde1384ce7b33e031a5916fd" data-path="images/mcp-setup/CC-MCP-2.mp4" />
  </Accordion>

  <Accordion title="GitHub Copilot">
    ### 安装

    将 InsForge MCP 服务器添加到你的 **GitHub Copilot**：

    1. 在下拉列表中选择 **Copilot**

    2. 打开终端，将以下安装命令粘贴到你的 **GitHub Copilot** 终端中

           <img src="https://mintcdn.com/insforge-468ccf39/fNI11NfWIUSxQDZ4/images/mcp-setup/copilot-1.png?fit=max&auto=format&n=fNI11NfWIUSxQDZ4&q=85&s=221c86348072caab475659fb65a2188e" alt="Copilot 设置" width="639" height="729" data-path="images/mcp-setup/copilot-1.png" />

    3. 运行该命令

           <img src="https://mintcdn.com/insforge-468ccf39/fNI11NfWIUSxQDZ4/images/mcp-setup/copilot-2.png?fit=max&auto=format&n=fNI11NfWIUSxQDZ4&q=85&s=99a7f3f7e10a96e2605ff8a33014b9a9" alt="Copilot 安装" width="2570" height="1328" data-path="images/mcp-setup/copilot-2.png" />

    ### 验证安装

    要验证连接，请在 **Copilot** 中开始一个新的聊天会话，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

    <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/mcp-connected.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=e801673f8bb2f67c08e7cca11595bf14" alt="MCP 已连接" width="470" height="44" data-path="images/mcp-setup/mcp-connected.png" />
  </Accordion>

  <Accordion title="Google Antigravity">
    ### 安装

    将 InsForge MCP 服务器添加到你的 **Antigravity**：

    1. 在下拉列表中选择 **Antigravity**

    2. 复制以下安装命令并粘贴到你的 **Antigravity** 终端中

           <img src="https://mintcdn.com/insforge-468ccf39/wwfpEGfpasa8WQ2v/images/mcp-setup/antigravity-1.png?fit=max&auto=format&n=wwfpEGfpasa8WQ2v&q=85&s=4735cea56722391aa50ba551bb069565" alt="Antigravity 设置" width="627" height="720" data-path="images/mcp-setup/antigravity-1.png" />

    3. 运行该命令

    <Frame>
      <video src="https://mintcdn.com/insforge-468ccf39/ioq-HbhhvPKTChxw/images/mcp-setup/Antigravity-MCP.mp4?fit=max&auto=format&n=ioq-HbhhvPKTChxw&q=85&s=713f4d34514b5bcbade8d7793d551d3e" autoPlay muted loop playsInline data-path="images/mcp-setup/Antigravity-MCP.mp4" />
    </Frame>

    ### 验证安装

    要验证连接，请在 **Antigravity** 中开始一个新的聊天会话，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

    <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/mcp-connected.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=e801673f8bb2f67c08e7cca11595bf14" alt="MCP 已连接" width="470" height="44" data-path="images/mcp-setup/mcp-connected.png" />
  </Accordion>

  <Accordion title="Kiro">
    ### 安装

    将 InsForge MCP 服务器添加到你的 **Kiro**：

    1. 在下拉列表中选择 **Kiro**

    2. 复制以下安装命令并粘贴到你的 **Kiro** 终端中

           <img src="https://mintcdn.com/insforge-468ccf39/5PTkTfA4J4SdXhFA/images/mcp-setup/kiro-1.png?fit=max&auto=format&n=5PTkTfA4J4SdXhFA&q=85&s=67abb6d17cddbba5fbca379434d40adb" alt="Kiro 设置" width="628" height="721" data-path="images/mcp-setup/kiro-1.png" />

    3. 运行该命令

    <Frame>
      <video src="https://mintcdn.com/insforge-468ccf39/ioq-HbhhvPKTChxw/images/mcp-setup/Kiro-MCP.mp4?fit=max&auto=format&n=ioq-HbhhvPKTChxw&q=85&s=edd8a983c31a5d90c50d8b4563604721" autoPlay muted loop playsInline data-path="images/mcp-setup/Kiro-MCP.mp4" />
    </Frame>

    ### 验证安装

    要验证连接，请在 **Kiro** 中开始一个新的聊天会话，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

    <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/mcp-connected.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=e801673f8bb2f67c08e7cca11595bf14" alt="MCP 已连接" width="470" height="44" data-path="images/mcp-setup/mcp-connected.png" />
  </Accordion>

  <Accordion title="Codex">
    ### 安装

    将 InsForge MCP 服务器添加到你的 **Codex**：

    1. 在下拉列表中选择 **Codex**

    2. 复制以下安装命令并粘贴到你的终端中

           <img src="https://mintcdn.com/insforge-468ccf39/5PTkTfA4J4SdXhFA/images/mcp-setup/codex-1.png?fit=max&auto=format&n=5PTkTfA4J4SdXhFA&q=85&s=2068920d304e6c480f50fdcd2f31bb53" alt="Codex 设置" width="632" height="725" data-path="images/mcp-setup/codex-1.png" />

    3. 运行该命令

    <Frame>
      <video src="https://mintcdn.com/insforge-468ccf39/ioq-HbhhvPKTChxw/images/mcp-setup/Codex-MCP.mp4?fit=max&auto=format&n=ioq-HbhhvPKTChxw&q=85&s=cd10c47b913ef5e4c1315299a91cc44a" autoPlay muted loop playsInline data-path="images/mcp-setup/Codex-MCP.mp4" />
    </Frame>

    ### 验证安装

    要验证连接，请在 **Codex** 中开始一个新的聊天会话，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

    <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/mcp-connected.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=e801673f8bb2f67c08e7cca11595bf14" alt="MCP 已连接" width="470" height="44" data-path="images/mcp-setup/mcp-connected.png" />
  </Accordion>

  <Accordion title="Cline">
    ### 安装

    将 InsForge MCP 服务器添加到你的 **Cline**：

    1. 在下拉列表中选择 **Cline**

    2. 复制以下安装命令并粘贴到你的 **Cline** 终端中

           <img src="https://mintcdn.com/insforge-468ccf39/fNI11NfWIUSxQDZ4/images/mcp-setup/cline-1.png?fit=max&auto=format&n=fNI11NfWIUSxQDZ4&q=85&s=dab0c00ea8e9fce316e779848106c00d" alt="Cline 设置" width="632" height="727" data-path="images/mcp-setup/cline-1.png" />

    3. 运行该命令

           <img src="https://mintcdn.com/insforge-468ccf39/fNI11NfWIUSxQDZ4/images/mcp-setup/cline-2.png?fit=max&auto=format&n=fNI11NfWIUSxQDZ4&q=85&s=e37c81b5d4aed0ae1b60eba94761d2b5" alt="Cline 安装" width="2578" height="1302" data-path="images/mcp-setup/cline-2.png" />

    ### 验证安装

    要验证连接，请在 **Cline** 中开始一个新的聊天会话，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

    <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/mcp-connected.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=e801673f8bb2f67c08e7cca11595bf14" alt="MCP 已连接" width="470" height="44" data-path="images/mcp-setup/mcp-connected.png" />
  </Accordion>

  <Accordion title="Windsurf">
    ### 安装

    将 InsForge MCP 服务器添加到你的 **Windsurf**：

    1. 在下拉列表中选择 **Windsurf**

    2. 复制以下安装命令并粘贴到你的 Windsurf 终端中

           <img src="https://mintcdn.com/insforge-468ccf39/lHUVwtL3JwYSI6Gh/images/mcp-setup/windsurf-1.png?fit=max&auto=format&n=lHUVwtL3JwYSI6Gh&q=85&s=91a6056a1e8088b515156f56490c4343" alt="Windsurf 设置" width="630" height="732" data-path="images/mcp-setup/windsurf-1.png" />

    3. 运行该命令

    ### 验证安装

    要验证连接，请在 **Windsurf** 中开始一个新的聊天会话，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

    <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/mcp-connected.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=e801673f8bb2f67c08e7cca11595bf14" alt="MCP 已连接" width="470" height="44" data-path="images/mcp-setup/mcp-connected.png" />
  </Accordion>

  <Accordion title="Trae">
    ### 安装

    将 InsForge MCP 服务器添加到你的 **Trae**：

    1. 在下拉列表中选择 **Trae**

    2. 复制以下安装命令并粘贴到你的 **Trae** 终端中

           <img src="https://mintcdn.com/insforge-468ccf39/lHUVwtL3JwYSI6Gh/images/mcp-setup/trae-1.png?fit=max&auto=format&n=lHUVwtL3JwYSI6Gh&q=85&s=a5e5faf52df23ee7f1d3efab722d299d" alt="Trae 设置" width="630" height="727" data-path="images/mcp-setup/trae-1.png" />

    3. 运行该命令

           <img src="https://mintcdn.com/insforge-468ccf39/lHUVwtL3JwYSI6Gh/images/mcp-setup/trae-2.png?fit=max&auto=format&n=lHUVwtL3JwYSI6Gh&q=85&s=259dd8b31ce81cddd11c01c0b01f92bf" alt="Trae 安装" width="3024" height="1890" data-path="images/mcp-setup/trae-2.png" />

    另外，Trae 还提供与 InsForge 的官方原生集成，你可以直接从 Trae 的官方 MCP 市场安装 InsForge：

    1. 打开 Trae 的 **Settings** → 进入 **MCP**

    2. 点击 **Add**，然后选择 **Add from Marketplace**

    3. 搜索 "InsForge" 并从市场中添加

           <img src="https://mintcdn.com/insforge-468ccf39/lHUVwtL3JwYSI6Gh/images/mcp-setup/trae-3.png?fit=max&auto=format&n=lHUVwtL3JwYSI6Gh&q=85&s=6719b557c7caad564b2eb3f3ce642cb1" alt="Trae 市场" width="3024" height="1890" data-path="images/mcp-setup/trae-3.png" />

    4. 所需的凭据 API\_KEY 和 API\_BASE\_URL，可以在你的 InsForge **Settings** 中的 **Connect** 选项卡下找到

           <img src="https://mintcdn.com/insforge-468ccf39/lHUVwtL3JwYSI6Gh/images/mcp-setup/trae-4.png?fit=max&auto=format&n=lHUVwtL3JwYSI6Gh&q=85&s=727db2b107ce3a9cfb2180dea3982c25" alt="Trae 凭据" width="1292" height="1043" data-path="images/mcp-setup/trae-4.png" />

    ### 验证安装

    要验证连接，请在 **Trae** 中开始一个新的聊天，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

    <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/mcp-connected.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=e801673f8bb2f67c08e7cca11595bf14" alt="MCP 已连接" width="470" height="44" data-path="images/mcp-setup/mcp-connected.png" />
  </Accordion>

  <Accordion title="Qoder">
    ### 安装

    将 InsForge MCP 服务器添加到你的 **Qoder**：

    1. 在下拉列表中选择 **Qoder**

    2. 复制以下安装命令并粘贴到你的 **Qoder** 终端中

           <img src="https://mintcdn.com/insforge-468ccf39/lHUVwtL3JwYSI6Gh/images/mcp-setup/qoder-1.png?fit=max&auto=format&n=lHUVwtL3JwYSI6Gh&q=85&s=37c6bc50f023b31739367445da1fd38b" alt="Qoder 设置" width="635" height="723" data-path="images/mcp-setup/qoder-1.png" />

    3. 运行该命令

    ### 验证安装

    要验证连接，请在 **Qoder** 中开始一个新的聊天会话，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

    <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/mcp-connected.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=e801673f8bb2f67c08e7cca11595bf14" alt="MCP 已连接" width="470" height="44" data-path="images/mcp-setup/mcp-connected.png" />
  </Accordion>

  <Accordion title="Roo Code">
    ### 安装

    将 InsForge MCP 服务器添加到你的 **Roo Code**：

    1. 在下拉列表中选择 **Roo Code**

    2. 复制以下安装命令并粘贴到你的 **Roo Code** 终端中

           <img src="https://mintcdn.com/insforge-468ccf39/lHUVwtL3JwYSI6Gh/images/mcp-setup/roocode-1.png?fit=max&auto=format&n=lHUVwtL3JwYSI6Gh&q=85&s=412db91485b669f7b98f532436954648" alt="Roo Code 设置" width="635" height="723" data-path="images/mcp-setup/roocode-1.png" />

    3. 运行该命令

    ### 验证安装

    要验证连接，请在 **Roo Code** 中开始一个新的聊天会话，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

    <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/mcp-connected.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=e801673f8bb2f67c08e7cca11595bf14" alt="MCP 已连接" width="470" height="44" data-path="images/mcp-setup/mcp-connected.png" />
  </Accordion>

  <Accordion title="OpenCode">
    ### 安装

    将 InsForge MCP 服务器添加到你的 **OpenCode**：

    1. 在下拉列表中选择 **OpenCode**

    2. 复制以下安装命令并粘贴到你的终端中

           <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/connect-project.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=4ef0e69172a5b685170cea8adec6b0c3" alt="连接项目" width="1246" height="1434" data-path="images/mcp-setup/connect-project.png" />

    3. 运行该命令

    ### 验证安装

    要验证连接，请在 **OpenCode** 中开始一个新的聊天会话，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

    <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/mcp-connected.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=e801673f8bb2f67c08e7cca11595bf14" alt="MCP 已连接" width="470" height="44" data-path="images/mcp-setup/mcp-connected.png" />
  </Accordion>

  <Accordion title="MCP JSON">
    ### 安装

    使用 MCP JSON 将 InsForge MCP 服务器添加到你的编程智能体：

    1. 在下拉列表中选择 **MCP JSON**
    2. 将以下 **MCP JSON** 配置复制并粘贴到你的智能体中

           <img src="https://mintcdn.com/insforge-468ccf39/lHUVwtL3JwYSI6Gh/images/mcp-setup/mcp-json-1.png?fit=max&auto=format&n=lHUVwtL3JwYSI6Gh&q=85&s=c9ffc9491236a1cf8fcf637e8c22cca1" alt="MCP JSON 设置" width="633" height="931" data-path="images/mcp-setup/mcp-json-1.png" />

    ### 验证安装

    要验证连接，请开始一个新的聊天会话，并向你的智能体发送以下提示词：

    ```
    I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
    learn about InsForge instructions.
    ```

    如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

    <img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/mcp-connected.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=e801673f8bb2f67c08e7cca11595bf14" alt="MCP 已连接" width="470" height="44" data-path="images/mcp-setup/mcp-connected.png" />
  </Accordion>
</AccordionGroup>

## 远程 MCP

最快的入门方式是使用远程 MCP。一条命令即可尝试安装，并会尝试自动处理身份验证和项目绑定，但如果自动流程无法完成，仍可能会提示你手动完成身份验证或项目绑定步骤。

在你的终端中运行以下命令：

```bash theme={null}
npx add-mcp https://mcp.insforge.dev/mcp
```

<Note>
  `add-mcp` 命令适用于大多数编程智能体，但并非所有。目前它支持：
  Claude Code、Claude Desktop、Codex、Cursor、Gemini CLI、Goose、GitHub Copilot、OpenCode、VS Code、Zed。
</Note>

运行该命令后，系统会自动为你的编程智能体生成一个配置文件。

### 连接并绑定项目

一些 MCP 客户端会在设置过程中自动提示你登录，而另一些客户端如果自动流程无法完成，则可能需要手动进行身份验证或项目绑定步骤。无论哪种方式，身份验证都会打开一个浏览器窗口，你可以在其中登录你的 InsForge 账户，并授予 MCP 客户端组织/项目访问权限。

<AccordionGroup>
  <Accordion title="Cursor">
    你可以在 `.cursor/mcp.json` 中找到配置文件，如下所示：

    ```json theme={null}
    {
      "mcpServers": {
        "insforge": {
          "url": "https://mcp.insforge.dev/mcp"
        }
      }
    }
    ```

    在菜单 **Preferences → Cursor Settings → Tools & MCP** 中，你应该会看到 InsForge MCP 服务器已成功添加。
    InsForge MCP 服务器状态为 "Needs authentication"，你可以点击 `connect` 按钮进行身份验证。
  </Accordion>

  <Accordion title="Claude Code">
    安装完成后，你会在 `.mcp.json` 中找到如下配置文件：

    ```json theme={null}
    {
      "mcpServers": {
        "insforge": {
          "type": "http",
          "url": "https://mcp.insforge.dev/mcp"
        }
      }
    }
    ```

    然后在常规终端（而非 IDE 扩展）中运行：

    ```sh theme={null}
    claude /mcp
    ```

    选择 "insforge" 服务器，然后选择 "Authenticate" 开始身份验证流程。
  </Accordion>

  <Accordion title="GitHub Copilot">
    安装完成后，你会在 `.vscode/mcp.json` 中找到如下配置文件：

    ```json theme={null}
    {
      "servers": {
        "insforge": {
          "type": "http",
          "url": "https://mcp.insforge.dev/mcp"
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="Google Antigravity">
    将以下配置添加到 `~/.gemini/antigravity/mcp_config.json`：

    ```json theme={null}
    {
      "mcpServers": {
        "insforge": {
          "serverUrl": "https://mcp.insforge.dev/mcp"
        }
      }
    }
    ```

    然后重启 Antigravity，它会自动进行身份验证。
  </Accordion>

  <Accordion title="Gemini">
    安装完成后，你会在 `.gemini/settings.json` 中找到如下配置文件：

    ```json theme={null}
    {
      "mcpServers": {
        "insforge": {
          "type": "http",
          "url": "https://mcp.insforge.dev/mcp"
        }
      }
    }
    ```

    启动 Gemini CLI 并运行以下命令以对服务器进行身份验证：

    ```sh theme={null}
    /mcp auth insforge
    ```
  </Accordion>

  <Accordion title="Codex">
    <Note>
      如果你是第一次使用 Codex，可能需要启用 rmcp 功能。为此，请在你的 `~/.codex/config.toml` 文件中添加以下内容：

      ```toml theme={null}
      [beta]
      rmcp = true
      ```
    </Note>

    安装完成后，你会在 `.codex/config.toml` 中找到如下配置文件：

    ```toml theme={null}
    [mcp_servers.insforge]
    type = "http"
    url = "https://mcp.insforge.dev/mcp"
    ```

    然后进行身份验证：

    ```sh theme={null}
    codex mcp login insforge
    ```

    最后，在 Codex 中运行 /mcp 以验证身份验证。

    或者，你也可以运行以下命令来安装 MCP 服务器：

    ```sh theme={null}
    codex mcp add insforge --url https://mcp.insforge.dev/mcp
    ```
  </Accordion>

  <Accordion title="Cline">
    你可以在终端中运行以下命令，将 InsForge MCP 服务器安装到你的 **Cline**：

    ```bash theme={null}
    npx -y @smithery/cli mcp add devel/insforge --client cline
    ```

    或者，你也可以参考官方 [Cline 文档](https://docs.cline.bot/mcp/connecting-to-a-remote-server)，通过以下参数添加 InsForge MCP 服务器：

    * Server Name: `insforge`
    * Server URL: `https://mcp.insforge.dev/mcp`
    * Transport Type: `Streamable HTTP`

    添加服务器后，你会看到一条要求进行身份验证的错误消息。点击出现的 "Authenticate" 按钮进行身份验证。
  </Accordion>

  <Accordion title="Windsurf">
    将以下配置添加到 `~/.codeium/windsurf/mcp_config.json`：

    ```json theme={null}
    {
      "mcpServers": {
        "insforge": {
          "command": "npx",
          "args": [
            "-y",
            "mcp-remote",
            "https://mcp.insforge.dev/mcp"
          ]
        }
      }
    }
    ```

    Windsurf 目前不支持通过 HTTP 传输的远程 MCP 服务器。你需要使用 mcp-remote 包作为代理。
  </Accordion>

  <Accordion title="Roo Code">
    你可以在终端中运行以下命令，将 InsForge MCP 服务器安装到你的 **Roo Code**：

    ```bash theme={null}
    npx -y @smithery/cli mcp add devel/insforge --client roocode
    ```
  </Accordion>

  <Accordion title="OpenCode">
    安装完成后，你会在 `./opencode.json` 中找到如下配置文件：

    ```json theme={null}
    {
      "mcp": {
        "insforge": {
          "type": "remote",
          "url": "https://mcp.insforge.dev/mcp",
          "enabled": true
        }
      }
    }
    ```

    然后运行以下命令进行身份验证：

    ```sh theme={null}
    opencode mcp auth insforge
    ```

    这将打开你的浏览器以完成 OAuth 身份验证流程。
  </Accordion>
</AccordionGroup>

### 验证安装

要验证连接，请在你的 AI 编程助手中开始一个新的聊天会话，并发送以下提示词：

```
I'm using InsForge as my backend platform, call InsForge MCP's fetch-docs tool to
learn about InsForge instructions.
```

如果连接成功，你会在 InsForge 控制台（右上角）看到 **MCP Connected** 状态指示。

<img src="https://mintcdn.com/insforge-468ccf39/-gcWtB6vS2JMKYEI/images/mcp-setup/mcp-connected.png?fit=max&auto=format&n=-gcWtB6vS2JMKYEI&q=85&s=e801673f8bb2f67c08e7cca11595bf14" alt="MCP 已连接" width="470" height="44" data-path="images/mcp-setup/mcp-connected.png" />

## 故障排查

<Accordion title="更改未生效">
  大多数 AI 客户端在 MCP 配置更改后需要完全重启。请关闭并重新打开应用程序。
</Accordion>
