{"title":"Cursor 中的 MCP","slug":"cursor","category":"mcp","summary":"把 Synapse 接入 Cursor IDE，为编码会话提供持久化的项目记忆。","audience":["human"],"tags":["mcp","cursor","ide","coding"],"difficulty":"intermediate","updated":"2026-06-27","word_count":191,"read_minutes":1,"lang":"zh","translated":true,"requested_lang":"zh","content_markdown":"\n# Cursor 中的 MCP\n\nCursor 是基于 VS Code 的 AI 驱动 IDE。借助 Synapse MCP，Cursor 在会话之间获得持久化记忆 — 它会记住你的项目决策、代码库模式和过往调试会话。\n\n## 前置条件\n\n- 已安装 Cursor IDE（<https://cursor.com>）\n- Node.js 18+\n- 你的 Synapse Mind Key\n\n## 配置\n\n### 第 1 步：打开 Cursor 设置\n\n在 Cursor 中：\n\n1. 打开设置（macOS Cmd+,，Windows/Linux Ctrl+,）\n2. 搜索 “MCP” 或导航到 `Cursor Settings → MCP Servers`\n\n### 第 2 步：添加 Synapse MCP Server\n\n点击 “Add MCP Server” 并配置：\n\n| 字段 | 值 |\n|-------|-------|\n| Name | `synapse` |\n| Type | `stdio` |\n| Command | `npx -y synapse-mcp-api@latest` |\n| Env | `SYNAPSE_MIND_KEY=mk_YOUR_KEY, SYNAPSE_URL=https://synapse.schaefer.zone` |\n\n### 第 3 步：直接编辑 config.json（备选）\n\nCursor 把 MCP 配置存储在 `~/.cursor/config.json`：\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_YOUR_MIND_KEY_HERE\",\n        \"SYNAPSE_URL\": \"https://synapse.schaefer.zone\"\n      }\n    }\n  }\n}\n```\n\n### 第 4 步：重启 Cursor\n\n完全重启 Cursor（macOS 上 Cmd+Q 后重新打开）。\n\n## 验证可用\n\n在 Cursor 的聊天面板中（Cmd+L）：\n\n```\nrecall all my memories\n```\n\nCursor 应调用 `memory_recall` 并返回你已存储的记忆。\n\n## 常见模式\n\n### 项目入门\n\n打开新项目时：\n\n```\nrecalling project context — what do I know about this codebase?\n```\n\nCursor 调用 `memory_recall` 并从中断处继续工作。\n\n### 架构决策\n\n```\nstore this decision: \"Using Fastify instead of Express for this project\nbecause of schema validation. Date: 2026-06-27.\"\n```\n\nCursor 把它存为 `project` 记忆，优先级 `high`。\n\n### 调试历史\n\n```\nwhat bugs have I hit in this codebase?\n```\n\nCursor 搜索 `mistake` 记忆并提醒你过往修复。\n\n### 跨会话代码模式\n\n```\nsearch memories: \"authentication pattern\"\n```\n\nCursor 找出你以前实现过的认证相关记忆。\n\n## 故障排查\n\n### MCP Server 未连接\n\n1. 验证 Node.js：`node --version`（≥ 18）\n2. 测试 MCP Server：`npx -y synapse-mcp-api@latest`（应无错启动）\n3. 查看 Cursor 的 MCP 日志（View → Output → MCP）\n4. 完全重启 Cursor\n\n### 工具未出现\n\n- 检查 `~/.cursor/config.json` 是否为有效 JSON\n- 验证 `SYNAPSE_MIND_KEY` 环境变量已设置\n- 检查 Cursor 版本是否支持 MCP（≥ 0.42）\n\n### Mind Key 无效\n\n```bash\n# 直接测试你的 Mind Key\ncurl -H \"Authorization: Bearer mk_YOUR_KEY\" \\\n     https://synapse.schaefer.zone/memory/recall\n```\n\n## 下一步\n\n- [Claude Desktop 配置](/docs/mcp/claude-desktop)\n- [Continue.dev 配置](/docs/mcp/continue)\n- [持久化 LLM Agent 指南](/docs/guides/persistent-llm-agent)\n","content_html":"<h1>Cursor 中的 MCP</h1>\n<p>Cursor 是基于 VS Code 的 AI 驱动 IDE。借助 Synapse MCP，Cursor 在会话之间获得持久化记忆 — 它会记住你的项目决策、代码库模式和过往调试会话。</p>\n<h2>前置条件</h2>\n<ul>\n<li>已安装 Cursor IDE（<a href=\"https://cursor.com\">https://cursor.com</a>）</li>\n<li>Node.js 18+</li>\n<li>你的 Synapse Mind Key</li>\n</ul>\n<h2>配置</h2>\n<h3>第 1 步：打开 Cursor 设置</h3>\n<p>在 Cursor 中：</p>\n<ol>\n<li>打开设置（macOS Cmd+,，Windows/Linux Ctrl+,）</li>\n<li>搜索 “MCP” 或导航到 <code>Cursor Settings → MCP Servers</code></li>\n</ol>\n<h3>第 2 步：添加 Synapse MCP Server</h3>\n<p>点击 “Add MCP Server” 并配置：</p>\n<table>\n<thead>\n<tr>\n<th>字段</th>\n<th>值</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Name</td>\n<td><code>synapse</code></td>\n</tr>\n<tr>\n<td>Type</td>\n<td><code>stdio</code></td>\n</tr>\n<tr>\n<td>Command</td>\n<td><code>npx -y synapse-mcp-api@latest</code></td>\n</tr>\n<tr>\n<td>Env</td>\n<td><code>SYNAPSE_MIND_KEY=mk_YOUR_KEY, SYNAPSE_URL=https://synapse.schaefer.zone</code></td>\n</tr>\n</tbody></table>\n<h3>第 3 步：直接编辑 config.json（备选）</h3>\n<p>Cursor 把 MCP 配置存储在 <code>~/.cursor/config.json</code>：</p>\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_YOUR_MIND_KEY_HERE&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>第 4 步：重启 Cursor</h3>\n<p>完全重启 Cursor（macOS 上 Cmd+Q 后重新打开）。</p>\n<h2>验证可用</h2>\n<p>在 Cursor 的聊天面板中（Cmd+L）：</p>\n<pre><code class=\"hljs language-plaintext\">recall all my memories</code></pre><p>Cursor 应调用 <code>memory_recall</code> 并返回你已存储的记忆。</p>\n<h2>常见模式</h2>\n<h3>项目入门</h3>\n<p>打开新项目时：</p>\n<pre><code class=\"hljs language-plaintext\">recalling project context — what do I know about this codebase?</code></pre><p>Cursor 调用 <code>memory_recall</code> 并从中断处继续工作。</p>\n<h3>架构决策</h3>\n<pre><code class=\"hljs language-plaintext\">store this decision: &quot;Using Fastify instead of Express for this project\nbecause of schema validation. Date: 2026-06-27.&quot;</code></pre><p>Cursor 把它存为 <code>project</code> 记忆，优先级 <code>high</code>。</p>\n<h3>调试历史</h3>\n<pre><code class=\"hljs language-plaintext\">what bugs have I hit in this codebase?</code></pre><p>Cursor 搜索 <code>mistake</code> 记忆并提醒你过往修复。</p>\n<h3>跨会话代码模式</h3>\n<pre><code class=\"hljs language-plaintext\">search memories: &quot;authentication pattern&quot;</code></pre><p>Cursor 找出你以前实现过的认证相关记忆。</p>\n<h2>故障排查</h2>\n<h3>MCP Server 未连接</h3>\n<ol>\n<li>验证 Node.js：<code>node --version</code>（≥ 18）</li>\n<li>测试 MCP Server：<code>npx -y synapse-mcp-api@latest</code>（应无错启动）</li>\n<li>查看 Cursor 的 MCP 日志（View → Output → MCP）</li>\n<li>完全重启 Cursor</li>\n</ol>\n<h3>工具未出现</h3>\n<ul>\n<li>检查 <code>~/.cursor/config.json</code> 是否为有效 JSON</li>\n<li>验证 <code>SYNAPSE_MIND_KEY</code> 环境变量已设置</li>\n<li>检查 Cursor 版本是否支持 MCP（≥ 0.42）</li>\n</ul>\n<h3>Mind Key 无效</h3>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># 直接测试你的 Mind Key</span>\ncurl -H <span class=\"hljs-string\">&quot;Authorization: Bearer mk_YOUR_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/memory/recall</code></pre><h2>下一步</h2>\n<ul>\n<li><a href=\"/docs/mcp/claude-desktop\">Claude Desktop 配置</a></li>\n<li><a href=\"/docs/mcp/continue\">Continue.dev 配置</a></li>\n<li><a href=\"/docs/guides/persistent-llm-agent\">持久化 LLM Agent 指南</a></li>\n</ul>\n","urls":{"html":"/docs/mcp/cursor","text":"/docs/mcp/cursor?format=text","json":"/docs/mcp/cursor?format=json","llm":"/docs/mcp/cursor?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}