語言EN
首頁
文件
參考資料 / MCP 整合

MCP 整合

Heddle 可以作為 Model Context Protocol host,讓 agent 使用 Notion、Anytype、GitHub 或其他 MCP server 生態系工具,而不必為每個服務寫專屬整合。

Heddle 中的 MCP 如何運作

MCP support 是 workspace-scoped,並由 operator 明確控制。你先設定 server,明確啟用 Heddle 可以連線的 server,刷新 tool catalog,之後的 agent turn 才能看到 cached MCP tools。

Configuration 不是 permission。儲存 MCP server config 不會啟用 server、不會刷新 tools,也不會授權 unattended execution。Tool call 仍然會經過 Heddle approval 與 trace。

基本流程

1. 貼上或編輯標準 MCP settings JSON 文件。
2. 針對目前工作區啟用一個已設定的 server。
3. 刷新 server,讓 Heddle cache 目前的 tool catalog。
4. 讓 agent 透過 Heddle 一般 tool path 檢視與呼叫 cached MCP tools。

設定 servers

使用常見的 mcpServers JSON shape。在瀏覽器 control plane 中,打開 Settings -> MCP,將完整 JSON 文件貼到 Configuration editor。若在 terminal chat,執行 /mcp config 可用平常的 editor 打開 .heddle/mcp.json。

{
  "mcpServers": {
    "notion": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "notion-mcp-server"],
      "env": {
        "NOTION_TOKEN": "${env:NOTION_TOKEN}"
      }
    },
    "anytype": {
      "type": "http",
      "url": "https://example.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:ANYTYPE_TOKEN}"
      }
    }
  }
}

指令

Slash command 與瀏覽器 settings page 會管理同一份工作區 MCP state。

/mcp
/mcp config
/mcp enable notion
/mcp refresh notion
/mcp disable notion

Agent 會看到什麼

Server 啟用並刷新後,Heddle 會暴露一個小型 MCP broker,以及由 cached catalog 產生的 namespaced tools。

mcp_list_tools

列出已啟用 server 與 cached MCP tools。

mcp_call_tool

對已啟用 server/tool 發出的 approval-gated broker call。

mcp__server__tool

從 cached catalog 產生的 namespaced adapter,例如 mcp__notion__search_pages。

安全模型

  • MCP server config 是外部 integration config,不是 trust grant。
  • 本機 stdio server 會用你的 OS 權限執行 command。啟用前請 review command、args、cwd 與 env。
  • MCP server description、tool description 與 output 都是外部內容,應視為 untrusted。
  • 使用 Heddle tool approval 與 trace 來 review MCP tool 被呼叫的內容與原因。

相關文件