> For the complete documentation index, see [llms.txt](https://docs.cherryai.com.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherryai.com.cn/docs/zhong-wen-fan-ti/advanced-basic/extensions/mcp.md).

# MCP 同外部工具

MCP 係畀 Agent 使用外部工具同資源嘅連接方式。Cherry Studio 可以管理 MCP 伺服器、內置伺服器、服務市場同部分服務商入口，再將已連接嘅伺服器綁定畀指定 Agent。

<figure><img src="/files/af6e92e70782071866b4e6ab2d1e29767bca17ac" alt="MCP 设置页面中的服务器列表、搜索和添加入口"><figcaption><p>喺【設定】→【MCP】統一睇伺服器狀態；先等一個伺服器單獨運行正常，再綁定畀 Agent。</p></figcaption></figure>

## 咩時候需要 MCP

* Agent 需要調用 Cherry Studio 內置工具之外嘅服務；
* 團隊已經有提供 MCP 接口嘅數據庫、瀏覽器或者業務系統；
* 希望同一套外部能力可以畀多個 Agent 重用；
* 需要用統一方式將工具、資源或者提示詞提供畀模型。

只需要固定流程時用技能，只需要檢索 Cherry Studio 知識庫時直接綁定知識庫，唔使為咗「更高級」而額外搭建 MCP。

<figure><img src="/files/75a6839d9e2296830402cb140b3612bc16b963f7" alt="MCP 服务器的快速创建、从 JSON 导入和手动创建方式"><figcaption><p>有服務方提供嘅 JSON 時可以直接導入；冇現成配置時再手動填寫命令或者地址。</p></figcaption></figure>

## 新增伺服器

路徑：【設定】→【MCP】→【MCP 伺服器】→【新增】。

{% stepper %}
{% step %}

### 1. 確認連接方式

本地命令通常使用標準輸入輸出方式；遠程服務通常提供 SSE 或可串流傳輸嘅 HTTP 地址。按照服務提供方畀出嘅配置填寫，唔好憑名猜測。
{% endstep %}

{% step %}

### 2. 填寫配置並檢查權限

本地伺服器需要命令、參數同環境變量；遠程伺服器需要 URL，部分服務仲需要授權。保存前確認命令來源同數據範圍。
{% endstep %}

{% step %}

### 3. 啟動並睇工具

啟用伺服器，等狀態正常，再打開詳情檢查佢提供嘅工具、資源同提示詞。連接失敗時先睇伺服器日誌。

喺工具列表入面展開某個工具，可以睇到完整嘅 Markdown 說明，同埋按層級展示嘅參數、類型、必填標記同枚舉值。調用前先核對必填參數；對象或陣列參數應逐層展開查看，避免只按工具名稱估輸入格式。
{% endstep %}

{% step %}

### 4. 綁定到 Agent

打開【工作】→ Agent 選單→【編輯】→【MCP】，啟用該伺服器。未啟動嘅伺服器無法正常綁定使用。
{% endstep %}
{% endstepper %}

## 內置伺服器同服務市場

【內置 MCP】提供可以直接安裝或啟用嘅常用能力；【服務市場】用嚟管理第三方市場來源。安裝前仍然要睇說明、命令、環境變量同權限，內置入口唔代表外部服務嘅所有操作都冇風險。

## 配置建議

| 配置項      | 產品預設值          | 建議起點              | 作用        | 適用場景          | 注意事項          |
| -------- | -------------- | ----------------- | --------- | ------------- | ------------- |
| 伺服器狀態    | 新增後按配置而定       | 一次只啟用一個並驗證        | 控制伺服器係咪可用 | 初次接入、排錯       | 多個服務同時失敗時好難定位 |
| Agent 綁定 | 唔自動綁定所有伺服器     | 只綁定當前 Agent 所需伺服器 | 控制能力範圍    | 多 Agent 分工    | 避免無關工具佔用上下文   |
| 環境變量     | 唔預填密鑰          | 使用服務要求嘅最小權限憑據     | 提供認證或運行參數 | 私有服務          | 截圖同導出前遮擋敏感內容  |
| 工具批准     | 由 Agent 權限模式決定 | 寫入或計費工具保持確認       | 防止意外操作    | 數據庫、文件、外部 API | 頻道入口可以用更嚴格模式  |

## 用戶案例：把項目數據庫接畀分析 Agent

管理員提供只讀 MCP 連接，用户喺【設定】→【MCP】驗證伺服器正常，再只綁定畀「數據分析」Agent。Agent 使用只讀工具攞數據，將報告寫入工作目錄；涉及更新數據嘅工具唔啟用。咁樣就算提示詞出現誤解，都唔會直接修改業務庫。

<details>

<summary>MCP 同 API 網關有咩分別？</summary>

MCP 係將外部工具接入 Cherry Studio；API 網關係將 Cherry Studio 嘅模型能力以兼容 API 提供畀其他程式。數據流方向相反。

</details>

<details>

<summary>伺服器顯示已連接，Agent 仍然搵唔到工具點算？</summary>

檢查 Agent 有冇綁定該伺服器、工具有冇被關閉、權限請求係咪未處理。修改 Agent 配置之後，再發一條訊息等運行時載入新工具。

</details>


---

# 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.cherryai.com.cn/docs/zhong-wen-fan-ti/advanced-basic/extensions/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.
