> For the complete documentation index, see [llms.txt](https://docs.verge.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verge.io/overview/zh/shi-yong-ai-gong-ju/connect-via-mcp.md).

# 通过 MCP 连接

VergeOS 文档发布了一个托管的 **MCP（模型上下文协议）服务器**。将其连接到 AI 助手——Claude、Cursor、VS Code Copilot、Codex 等——该助手就可以在帮助你的同时直接搜索和阅读这些文档，而不是靠猜测或依赖过时的训练数据。

{% hint style="info" %}
你需要一个支持 **通过 HTTP 连接远程 MCP 服务器**的客户端。该服务器是公开的，因此不需要 API 密钥或登录。
{% endhint %}

## 该服务器

|          |                                      |
| -------- | ------------------------------------ |
| **URL**  | `https://docs.verge.io/~gitbook/mcp` |
| **传输方式** | 可流式 HTTP                             |
| **身份验证** | 无（公开）                                |

## 添加服务器

{% tabs %}
{% tab title="Claude Code" %}
运行 CLI 命令，将其添加到你的用户账户：

```bash
claude mcp add vergeos-docs --scope user --transport http https://docs.verge.io/~gitbook/mcp
```

然后确认它已连接：

```bash
claude mcp list
```

{% endtab %}

{% tab title="Claude Desktop" %}

1. 打开 **设置 → 连接器**.
2. 选择 **添加自定义连接器**.
3. 将其命名为 `VergeOS Docs` 并将 URL 设置为：

   ```
   https://docs.verge.io/~gitbook/mcp
   ```
4. 保存，然后在新的聊天中启用该连接器。
   {% endtab %}

{% tab title="Cursor" %}
将服务器添加到 `~/.cursor/mcp.json` （全局）或 `.cursor/mcp.json` （按项目）：

```json
{
  "mcpServers": {
    "vergeos-docs": {
      "url": "https://docs.verge.io/~gitbook/mcp"
    }
  }
}
```

{% endtab %}

{% tab title="VS Code" %}
使用一键安装链接：

```
vscode:mcp/install?%7B%22name%22%3A%22VergeOS%20Docs%22%2C%22url%22%3A%22https%3A%2F%2Fdocs.verge.io%2F~gitbook%2Fmcp%22%7D
```

或者手动添加到 `.vscode/mcp.json`:

```json
{
  "servers": {
    "VergeOS Docs": {
      "url": "https://docs.verge.io/~gitbook/mcp"
    }
  }
}
```

{% endtab %}

{% tab title="Codex" %}
运行 CLI 命令：

```bash
codex mcp add vergeos-docs --url https://docs.verge.io/~gitbook/mcp
```

{% endtab %}
{% endtabs %}

## 你将获得什么

连接后，助手会获得两个工具：

* **`searchDocumentation`** — 在所有 VergeOS Docs 中搜索，并返回匹配内容及直接页面链接。
* **`getPage`** — 获取某个特定文档页面的完整 Markdown。

## 试试看

向你的助手提出一个应该从文档中获取答案的问题，例如：

{% hint style="success" %}

* “在 VergeOS 文档中搜索如何配置站点同步。”
* “使用 VergeOS 文档，总结将虚拟机从 VMware 迁移的步骤。”
* “VergeOS 文档对边缘部署的节点规模说明了什么？”
  {% endhint %}

如果这些工具可用，并且答案引用了 VergeOS Docs 页面，说明连接已正常工作。

## 进一步使用代理技能

MCP 服务器为助手提供对文档的读取访问。如果你使用 **Claude Code** 或 **Codex**， [VergeOS 代理技能](/overview/zh/shi-yong-ai-gong-ju/agent-skills.md) 包会在此基础上增加面向任务的工作流——故障排除、诊断、培训和基础设施管理，通过 `vrg` CLI——并为你打包同一个文档 MCP 服务器。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.verge.io/overview/zh/shi-yong-ai-gong-ju/connect-via-mcp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
