{"title":"MCP 是什么？","slug":"what-is-mcp","category":"mcp","summary":"Model Context Protocol 让 LLM 调用外部工具。Synapse 通过官方 MCP Server 暴露 79 个工具。","audience":["human","llm"],"tags":["mcp","intro","overview"],"difficulty":"beginner","updated":"2026-06-27","word_count":426,"read_minutes":2,"llm_context":"MCP = Model Context Protocol (Anthropic, 2024). Open standard for LLM-tool integration.\nSynapse has official MCP server: synapse-mcp-api (npm package, npx -y synapse-mcp-api@latest)\n79 tools exposed: 22 memory, 7 chat, 8 scheduler, 4 tasks, 5 scripts, 9 computers, 4 push, 5 user, 3 utility\n3 transports: stdio (local), HTTP/SSE (remote), WebSocket (mobile)\nSupported clients: Claude Desktop, Claude Code, Cursor, Continue, Cline, any MCP-compatible client\nTool Profiles (v1.4.0): minimal (8 tools), standard (25), full (119) — controlled via MCP_PROFILE env or Mcp-Tool-Profile header\n","lang":"zh","translated":true,"requested_lang":"zh","content_markdown":"\n# MCP 是什么？\n\n**Model Context Protocol (MCP)** 是 Anthropic 于 2024 年推出的开放标准，让 LLM 以结构化方式调用外部工具。你不需要把 API 文档粘到 prompt 里，而是把工具注册到 MCP Server，LLM 按需调用 — 类似 function calling，但标准化且与客户端无关。\n\n## Synapse MCP Server\n\nSynapse 提供官方 MCP Server（npm 上的 `synapse-mcp-api`），暴露覆盖所有 Synapse 功能的 **79 个工具**：\n\n| 分类 | 工具 | 数量 |\n|----------|-------|-------|\n| Memory | recall, list, store, search, semantic-search, update, delete, bulk-delete, stats, unverified, contradictions, audit, related, by-tag, diff, expiring, health, sync, embed-batch, verify, unverify, mind-export | 22 |\n| Chat | poll, reply, status, history, unread, send, upload | 7 |\n| Scheduler | cron_list, cron_create, cron_delete, cron_toggle, var_list, var_get, var_set, var_delete | 8 |\n| Tasks | task_list, task_get, task_create, task_update | 4 |\n| Scripts | script_list, script_get, script_info, script_store, script_delete | 5 |\n| Computers | computer_list, computer_get, install_code, screenshot, command_queue, command_status, commands_list, disable, delete | 9 |\n| Push | vapid_public_key, subscribe, unsubscribe, test | 4 |\n| User/Mind | register, login, minds_list, mind_create, mind_delete | 5 |\n| Utility | time, calc, random | 3 |\n| Visualization | graph, tags, compact | 3 |\n| Sharing | share, list, revoke | 3 |\n| Webhooks | register, list, get, update, delete | 5 |\n| Browser | new, navigate, click, type, screenshot, close | 6 |\n| **合计** | | **79+** |\n\n## 工作原理\n\n```\n┌──────────────────┐    MCP 协议     ┌──────────────────┐    HTTP    ┌──────────┐\n│  LLM 客户端      │ ◀─────────────────▶│  Synapse MCP     │ ─────────▶ │ Synapse  │\n│ (Claude/Cursor)  │   (stdio/SSE/WS)   │  Server          │            │ API      │\n└──────────────────┘                    └──────────────────┘            └──────────┘\n```\n\n1. 你把 LLM 客户端（Claude Desktop、Cursor 等）配置为使用 Synapse MCP Server\n2. 客户端启动 MCP Server（通过 `npx -y synapse-mcp-api@latest`）\n3. MCP Server 用你的 Mind Key 连接到 Synapse API\n4. LLM 看到全部 79 个工具，作为可调用的原生函数\n5. 当 LLM 需要记住某事时，它调用 `memory_store` — MCP Server 把它翻译为 Synapse 上的 `POST /memory`\n\n## 传输方式\n\nSynapse MCP Server 支持三种传输方式：\n\n### stdio（本地，桌面端推荐）\n\n```json\n{\n  \"mcpServers\": {\n    \"synapse\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"synapse-mcp-api@latest\"],\n      \"env\": {\n        \"SYNAPSE_MIND_KEY\": \"mk_...\",\n        \"SYNAPSE_URL\": \"https://synapse.schaefer.zone\"\n      }\n    }\n  }\n}\n```\n\n### HTTP/SSE（远程，多租户）\n\n把你的 MCP 客户端连接到：\n\n```\nURL: https://synapse-mcp.schaefer.zone/sse\nHeaders: Authorization: Bearer YOUR_MIND_KEY\n```\n\n### WebSocket（移动端，高吞吐）\n\n```\nURL: wss://synapse-mcp.schaefer.zone/ws?mind_key=YOUR_MIND_KEY\n```\n\n## 工具配置文件（v1.4.0）\n\n为减小较小 LLM 的 token 开销，MCP Server 支持三种工具配置文件：\n\n| 配置文件 | 工具 | Tokens | 适合 |\n|---------|-------|--------|----------|\n| `minimal` | 8（组合分发） | ~500 | 上下文 ≤8k 的自托管 LLM |\n| `standard` | 25（命名） | ~2,500 | 中等大小 LLM（Claude Haiku、GPT-3.5） |\n| `full` | 119（全部） | ~8,250 | 大型 LLM（Claude Sonnet/Opus、GPT-4） — 默认 |\n\n控制方式：\n\n- 环境变量：`MCP_PROFILE=minimal|standard|full`\n- 头：`Mcp-Tool-Profile: minimal|standard|full`\n\n## 支持的客户端\n\n- [Claude Desktop](/docs/mcp/claude-desktop) — Anthropic 的桌面应用\n- [Claude Code](/docs/mcp/claude-code) — 终端编码 Agent\n- [Cursor](/docs/mcp/cursor) — AI 驱动的 IDE\n- [Continue.dev](/docs/mcp/continue) — 开源 AI 编码助手\n- [Cline](/docs/mcp/claude-code) — VS Code 扩展\n- 任何兼容 MCP 的客户端\n\n## 为什么用 MCP 而非直接 API？\n\n| 方式 | 优点 | 缺点 |\n|----------|------|------|\n| 直接 API | 简单，无额外层 | LLM 需要知道 URL、请求头、认证 |\n| MCP | LLM 看到原生工具，无需记 URL | 多一个 MCP Server 进程 |\n\n对于大多数 LLM Agent 用例，MCP 是更好的选择 — LLM 不需要记 API 路径或认证模式。\n\n## 下一步\n\n- [Claude Desktop 配置](/docs/mcp/claude-desktop) — 2 分钟配置\n- [Claude Code 配置](/docs/mcp/claude-code) — 终端集成\n- [自定义 MCP 客户端](/docs/mcp/custom-client) — 自建客户端\n","content_html":"<h1>MCP 是什么？</h1>\n<p><strong>Model Context Protocol (MCP)</strong> 是 Anthropic 于 2024 年推出的开放标准，让 LLM 以结构化方式调用外部工具。你不需要把 API 文档粘到 prompt 里，而是把工具注册到 MCP Server，LLM 按需调用 — 类似 function calling，但标准化且与客户端无关。</p>\n<h2>Synapse MCP Server</h2>\n<p>Synapse 提供官方 MCP Server（npm 上的 <code>synapse-mcp-api</code>），暴露覆盖所有 Synapse 功能的 <strong>79 个工具</strong>：</p>\n<table>\n<thead>\n<tr>\n<th>分类</th>\n<th>工具</th>\n<th>数量</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Memory</td>\n<td>recall, list, store, search, semantic-search, update, delete, bulk-delete, stats, unverified, contradictions, audit, related, by-tag, diff, expiring, health, sync, embed-batch, verify, unverify, mind-export</td>\n<td>22</td>\n</tr>\n<tr>\n<td>Chat</td>\n<td>poll, reply, status, history, unread, send, upload</td>\n<td>7</td>\n</tr>\n<tr>\n<td>Scheduler</td>\n<td>cron_list, cron_create, cron_delete, cron_toggle, var_list, var_get, var_set, var_delete</td>\n<td>8</td>\n</tr>\n<tr>\n<td>Tasks</td>\n<td>task_list, task_get, task_create, task_update</td>\n<td>4</td>\n</tr>\n<tr>\n<td>Scripts</td>\n<td>script_list, script_get, script_info, script_store, script_delete</td>\n<td>5</td>\n</tr>\n<tr>\n<td>Computers</td>\n<td>computer_list, computer_get, install_code, screenshot, command_queue, command_status, commands_list, disable, delete</td>\n<td>9</td>\n</tr>\n<tr>\n<td>Push</td>\n<td>vapid_public_key, subscribe, unsubscribe, test</td>\n<td>4</td>\n</tr>\n<tr>\n<td>User/Mind</td>\n<td>register, login, minds_list, mind_create, mind_delete</td>\n<td>5</td>\n</tr>\n<tr>\n<td>Utility</td>\n<td>time, calc, random</td>\n<td>3</td>\n</tr>\n<tr>\n<td>Visualization</td>\n<td>graph, tags, compact</td>\n<td>3</td>\n</tr>\n<tr>\n<td>Sharing</td>\n<td>share, list, revoke</td>\n<td>3</td>\n</tr>\n<tr>\n<td>Webhooks</td>\n<td>register, list, get, update, delete</td>\n<td>5</td>\n</tr>\n<tr>\n<td>Browser</td>\n<td>new, navigate, click, type, screenshot, close</td>\n<td>6</td>\n</tr>\n<tr>\n<td><strong>合计</strong></td>\n<td></td>\n<td><strong>79+</strong></td>\n</tr>\n</tbody></table>\n<h2>工作原理</h2>\n<pre><code class=\"hljs language-plaintext\">┌──────────────────┐    MCP 协议     ┌──────────────────┐    HTTP    ┌──────────┐\n│  LLM 客户端      │ ◀─────────────────▶│  Synapse MCP     │ ─────────▶ │ Synapse  │\n│ (Claude/Cursor)  │   (stdio/SSE/WS)   │  Server          │            │ API      │\n└──────────────────┘                    └──────────────────┘            └──────────┘</code></pre><ol>\n<li>你把 LLM 客户端（Claude Desktop、Cursor 等）配置为使用 Synapse MCP Server</li>\n<li>客户端启动 MCP Server（通过 <code>npx -y synapse-mcp-api@latest</code>）</li>\n<li>MCP Server 用你的 Mind Key 连接到 Synapse API</li>\n<li>LLM 看到全部 79 个工具，作为可调用的原生函数</li>\n<li>当 LLM 需要记住某事时，它调用 <code>memory_store</code> — MCP Server 把它翻译为 Synapse 上的 <code>POST /memory</code></li>\n</ol>\n<h2>传输方式</h2>\n<p>Synapse MCP Server 支持三种传输方式：</p>\n<h3>stdio（本地，桌面端推荐）</h3>\n<pre><code class=\"hljs language-json\"><span class=\"hljs-punctuation\">{</span>\n  <span class=\"hljs-attr\">&quot;mcpServers&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">{</span>\n    <span class=\"hljs-attr\">&quot;synapse&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">{</span>\n      <span class=\"hljs-attr\">&quot;command&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;npx&quot;</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;args&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">[</span><span class=\"hljs-string\">&quot;-y&quot;</span><span class=\"hljs-punctuation\">,</span> <span class=\"hljs-string\">&quot;synapse-mcp-api@latest&quot;</span><span class=\"hljs-punctuation\">]</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;env&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">{</span>\n        <span class=\"hljs-attr\">&quot;SYNAPSE_MIND_KEY&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;mk_...&quot;</span><span class=\"hljs-punctuation\">,</span>\n        <span class=\"hljs-attr\">&quot;SYNAPSE_URL&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone&quot;</span>\n      <span class=\"hljs-punctuation\">}</span>\n    <span class=\"hljs-punctuation\">}</span>\n  <span class=\"hljs-punctuation\">}</span>\n<span class=\"hljs-punctuation\">}</span></code></pre><h3>HTTP/SSE（远程，多租户）</h3>\n<p>把你的 MCP 客户端连接到：</p>\n<pre><code class=\"hljs language-plaintext\">URL: https://synapse-mcp.schaefer.zone/sse\nHeaders: Authorization: Bearer YOUR_MIND_KEY</code></pre><h3>WebSocket（移动端，高吞吐）</h3>\n<pre><code class=\"hljs language-plaintext\">URL: wss://synapse-mcp.schaefer.zone/ws?mind_key=YOUR_MIND_KEY</code></pre><h2>工具配置文件（v1.4.0）</h2>\n<p>为减小较小 LLM 的 token 开销，MCP Server 支持三种工具配置文件：</p>\n<table>\n<thead>\n<tr>\n<th>配置文件</th>\n<th>工具</th>\n<th>Tokens</th>\n<th>适合</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>minimal</code></td>\n<td>8（组合分发）</td>\n<td>~500</td>\n<td>上下文 ≤8k 的自托管 LLM</td>\n</tr>\n<tr>\n<td><code>standard</code></td>\n<td>25（命名）</td>\n<td>~2,500</td>\n<td>中等大小 LLM（Claude Haiku、GPT-3.5）</td>\n</tr>\n<tr>\n<td><code>full</code></td>\n<td>119（全部）</td>\n<td>~8,250</td>\n<td>大型 LLM（Claude Sonnet/Opus、GPT-4） — 默认</td>\n</tr>\n</tbody></table>\n<p>控制方式：</p>\n<ul>\n<li>环境变量：<code>MCP_PROFILE=minimal|standard|full</code></li>\n<li>头：<code>Mcp-Tool-Profile: minimal|standard|full</code></li>\n</ul>\n<h2>支持的客户端</h2>\n<ul>\n<li><a href=\"/docs/mcp/claude-desktop\">Claude Desktop</a> — Anthropic 的桌面应用</li>\n<li><a href=\"/docs/mcp/claude-code\">Claude Code</a> — 终端编码 Agent</li>\n<li><a href=\"/docs/mcp/cursor\">Cursor</a> — AI 驱动的 IDE</li>\n<li><a href=\"/docs/mcp/continue\">Continue.dev</a> — 开源 AI 编码助手</li>\n<li><a href=\"/docs/mcp/claude-code\">Cline</a> — VS Code 扩展</li>\n<li>任何兼容 MCP 的客户端</li>\n</ul>\n<h2>为什么用 MCP 而非直接 API？</h2>\n<table>\n<thead>\n<tr>\n<th>方式</th>\n<th>优点</th>\n<th>缺点</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>直接 API</td>\n<td>简单，无额外层</td>\n<td>LLM 需要知道 URL、请求头、认证</td>\n</tr>\n<tr>\n<td>MCP</td>\n<td>LLM 看到原生工具，无需记 URL</td>\n<td>多一个 MCP Server 进程</td>\n</tr>\n</tbody></table>\n<p>对于大多数 LLM Agent 用例，MCP 是更好的选择 — LLM 不需要记 API 路径或认证模式。</p>\n<h2>下一步</h2>\n<ul>\n<li><a href=\"/docs/mcp/claude-desktop\">Claude Desktop 配置</a> — 2 分钟配置</li>\n<li><a href=\"/docs/mcp/claude-code\">Claude Code 配置</a> — 终端集成</li>\n<li><a href=\"/docs/mcp/custom-client\">自定义 MCP 客户端</a> — 自建客户端</li>\n</ul>\n","urls":{"html":"/docs/mcp/what-is-mcp","text":"/docs/mcp/what-is-mcp?format=text","json":"/docs/mcp/what-is-mcp?format=json","llm":"/docs/mcp/what-is-mcp?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}