{"title":"MCP ใน Cursor","slug":"cursor","category":"mcp","summary":"เชื่อมต่อ Synapse กับ Cursor IDE สำหรับ memory โปรเจกต์ถาวรข้าม coding session","audience":["human"],"tags":["mcp","cursor","ide","coding"],"difficulty":"intermediate","updated":"2026-06-27","word_count":235,"read_minutes":1,"lang":"th","translated":true,"requested_lang":"th","content_markdown":"\n# MCP ใน Cursor\n\nCursor เป็น IDE ที่ขับเคลื่อนด้วย AI ที่สร้างบน VS Code ด้วย Synapse MCP, Cursor ได้ memory ถาวรข้าม session — จดจำการตัดสินใจโปรเจกต์, รูปแบบ codebase, และ session debugging ในอดีต\n\n## ข้อกำหนดเบื้องต้น\n\n- ติดตั้ง Cursor IDE (<https://cursor.com>)\n- Node.js 18+\n- Synapse Mind Key ของคุณ\n\n## การตั้งค่า\n\n### ขั้นตอนที่ 1: เปิด Cursor Settings\n\nใน Cursor:\n\n1. เปิด Settings (Cmd+, บน macOS, Ctrl+, บน Windows/Linux)\n2. ค้นหา \"MCP\" หรือนำทางไปยัง `Cursor Settings → MCP Servers`\n\n### ขั้นตอนที่ 2: เพิ่ม Synapse MCP Server\n\nคลิก \"Add MCP Server\" และกำหนดค่า:\n\n| Field | Value |\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 config ใน `~/.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 ให้เต็มรูปแบบ (Cmd+Q และเปิดใหม่บน macOS)\n\n## ตรวจสอบว่าทำงาน\n\nในพาเนลแช็ตของ Cursor (Cmd+L):\n\n```\nrecall all my memories\n```\n\nCursor ควรเรียก `memory_recall` และตอบกลับด้วย memory ที่เก็บไว้ของคุณ\n\n## รูปแบบทั่วไป\n\n### Onboarding โปรเจกต์\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 เก็บเป็น memory `project` พร้อม priority `high`\n\n### ประวัติ debugging\n\n```\nwhat bugs have I hit in this codebase?\n```\n\nCursor ค้นหา memory `mistake` และเตือนคุณเกี่ยวกับการแก้ไขในอดีต\n\n### รูปแบบ code ข้าม session\n\n```\nsearch memories: \"authentication pattern\"\n```\n\nCursor หา memory เกี่ยวกับการ implement auth ที่คุณเคยทำ\n\n## การแก้ปัญหา\n\n### MCP server เชื่อมต่อไม่ได้\n\n1. ตรวจ Node.js: `node --version` (≥ 18)\n2. ทดสอบ MCP server: `npx -y synapse-mcp-api@latest` (ควรเริ่มโดยไม่มี error)\n3. ตรวจ MCP log ของ Cursor (View → Output → MCP)\n4. รีสตาร์ท Cursor ให้เต็มรูปแบบ\n\n### tool ไม่ปรากฏ\n\n- ตรวจ `~/.cursor/config.json` เป็น JSON ที่ถูกต้อง\n- ตรวจ env var `SYNAPSE_MIND_KEY` ตั้งแล้ว\n- ตรวจเวอร์ชัน Cursor รองรับ MCP (≥ 0.42)\n\n### Mind Key ไม่ถูกต้อง\n\n```bash\n# Test your Mind Key directly\ncurl -H \"Authorization: Bearer mk_YOUR_KEY\" \\\n     https://synapse.schaefer.zone/memory/recall\n```\n\n## ขั้นตอนถัดไป\n\n- [Claude Desktop Setup](/docs/mcp/claude-desktop)\n- [Continue.dev Setup](/docs/mcp/continue)\n- [Persistent LLM Agent Guide](/docs/guides/persistent-llm-agent)\n","content_html":"<h1>MCP ใน Cursor</h1>\n<p>Cursor เป็น IDE ที่ขับเคลื่อนด้วย AI ที่สร้างบน VS Code ด้วย Synapse MCP, Cursor ได้ memory ถาวรข้าม session — จดจำการตัดสินใจโปรเจกต์, รูปแบบ codebase, และ session debugging ในอดีต</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 Settings</h3>\n<p>ใน Cursor:</p>\n<ol>\n<li>เปิด Settings (Cmd+, บน macOS, Ctrl+, บน Windows/Linux)</li>\n<li>ค้นหา &quot;MCP&quot; หรือนำทางไปยัง <code>Cursor Settings → MCP Servers</code></li>\n</ol>\n<h3>ขั้นตอนที่ 2: เพิ่ม Synapse MCP Server</h3>\n<p>คลิก &quot;Add MCP Server&quot; และกำหนดค่า:</p>\n<table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Value</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 config ใน <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 ให้เต็มรูปแบบ (Cmd+Q และเปิดใหม่บน macOS)</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> และตอบกลับด้วย memory ที่เก็บไว้ของคุณ</p>\n<h2>รูปแบบทั่วไป</h2>\n<h3>Onboarding โปรเจกต์</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 เก็บเป็น memory <code>project</code> พร้อม priority <code>high</code></p>\n<h3>ประวัติ debugging</h3>\n<pre><code class=\"hljs language-plaintext\">what bugs have I hit in this codebase?</code></pre><p>Cursor ค้นหา memory <code>mistake</code> และเตือนคุณเกี่ยวกับการแก้ไขในอดีต</p>\n<h3>รูปแบบ code ข้าม session</h3>\n<pre><code class=\"hljs language-plaintext\">search memories: &quot;authentication pattern&quot;</code></pre><p>Cursor หา memory เกี่ยวกับการ implement auth ที่คุณเคยทำ</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> (ควรเริ่มโดยไม่มี error)</li>\n<li>ตรวจ MCP log ของ Cursor (View → Output → MCP)</li>\n<li>รีสตาร์ท Cursor ให้เต็มรูปแบบ</li>\n</ol>\n<h3>tool ไม่ปรากฏ</h3>\n<ul>\n<li>ตรวจ <code>~/.cursor/config.json</code> เป็น JSON ที่ถูกต้อง</li>\n<li>ตรวจ env var <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\"># Test your Mind Key directly</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 Setup</a></li>\n<li><a href=\"/docs/mcp/continue\">Continue.dev Setup</a></li>\n<li><a href=\"/docs/guides/persistent-llm-agent\">Persistent LLM Agent Guide</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"]}