{"title":"MCP in Claude Code","slug":"claude-code","category":"mcp","summary":"Use Synapse tools from the Claude Code terminal agent — persistent memory for coding sessions.","audience":["human","llm"],"tags":["mcp","claude-code","terminal","coding"],"difficulty":"intermediate","updated":"2026-06-27","word_count":213,"read_minutes":1,"llm_context":"Claude Code config: ~/.claude/config.json (or via `claude mcp add` command)\nCommand: npx -y synapse-mcp-api@latest\nEnv: SYNAPSE_MIND_KEY (required), SYNAPSE_URL (optional)\nAlternative: `claude mcp add synapse -- npx -y synapse-mcp-api@latest`\nThen: set SYNAPSE_MIND_KEY env var in your shell\nTest: in claude code, type \"recall all my memories\"\n","lang":"en","translated":true,"requested_lang":"en","content_markdown":"\n# MCP in Claude Code\n\nClaude Code is Anthropic's terminal-based coding agent. With Synapse MCP,\nClaude Code gains persistent memory across coding sessions — it remembers\nyour project context, past decisions, and codebase patterns.\n\n## Setup\n\n### Method 1: CLI Command (recommended)\n\n```bash\n# Add Synapse as an MCP server\nclaude mcp add synapse -- npx -y synapse-mcp-api@latest\n\n# Set your Mind Key as env var (add to ~/.bashrc or ~/.zshrc)\nexport SYNAPSE_MIND_KEY=\"mk_YOUR_MIND_KEY_HERE\"\nexport SYNAPSE_URL=\"https://synapse.schaefer.zone\"  # optional, defaults to synapse.schaefer.zone\n```\n\n### Method 2: Edit Config File\n\nEdit `~/.claude/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## Verify It Works\n\nStart Claude Code:\n\n```bash\nclaude\n```\n\nIn the Claude Code prompt, type:\n\n```\nrecall all my memories\n```\n\nClaude should call `memory_recall` and respond with your stored memories.\n\n## Common Patterns\n\n### Project context persistence\n\nAt the start of a coding session:\n\n```\nrecalling my memories — what projects am I working on?\n```\n\nClaude calls `memory_recall`, sees your project list, and continues work\nwhere you left off.\n\n### Codebase decisions\n\nWhen you make an architectural decision:\n\n```\nstore this: \"We chose PostgreSQL over SQLite because of concurrent write\nperformance. Decision made on 2026-06-27.\"\n```\n\nClaude calls `memory_store` with category `project`, priority `high`.\n\n### Avoiding past mistakes\n\n```\nwhat mistakes have I made with this codebase?\n```\n\nClaude searches memories with category `mistake` and reminds you of past errors.\n\n### Task tracking\n\n```\ncreate a task: \"Refactor auth module to use JWT refresh tokens\"\n```\n\nClaude calls `task_create`, and the task persists across sessions.\n\n## Tool Profiles\n\nFor coding sessions where you don't need all 119 tools:\n\n```bash\n# Set profile via env var\nexport MCP_PROFILE=\"standard\"  # 25 tools, ~2500 tokens\n\n# Or in config.json\n\"env\": {\n  \"SYNAPSE_MIND_KEY\": \"mk_...\",\n  \"MCP_PROFILE\": \"standard\"\n}\n```\n\n## Troubleshooting\n\n### MCP server not starting\n\n```bash\n# Test the MCP server manually\nnpx -y synapse-mcp-api@latest\n\n# Should print:\n# [info] synapse-mcp Streamable HTTP server ready\n# [info]   MCP:      http://localhost:13100/mcp\n```\n\n### Mind Key not recognized\n\n```bash\n# Verify env var is set\necho $SYNAPSE_MIND_KEY\n\n# Test directly\ncurl -H \"Authorization: Bearer $SYNAPSE_MIND_KEY\" \\\n     https://synapse.schaefer.zone/memory/recall\n```\n\n### Claude Code doesn't see tools\n\n- Restart Claude Code after config changes\n- Check `claude mcp list` to verify Synapse is registered\n- See [MCP Troubleshooting](/docs/mcp/troubleshooting)\n\n## Next Steps\n\n- [Claude Desktop Setup](/docs/mcp/claude-desktop)\n- [Cursor Setup](/docs/mcp/cursor)\n- [Persistent LLM Agent Guide](/docs/guides/persistent-llm-agent)\n","content_html":"<h1>MCP in Claude Code</h1>\n<p>Claude Code is Anthropic&#39;s terminal-based coding agent. With Synapse MCP,\nClaude Code gains persistent memory across coding sessions — it remembers\nyour project context, past decisions, and codebase patterns.</p>\n<h2>Setup</h2>\n<h3>Method 1: CLI Command (recommended)</h3>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Add Synapse as an MCP server</span>\nclaude mcp add synapse -- npx -y synapse-mcp-api@latest\n\n<span class=\"hljs-comment\"># Set your Mind Key as env var (add to ~/.bashrc or ~/.zshrc)</span>\n<span class=\"hljs-built_in\">export</span> SYNAPSE_MIND_KEY=<span class=\"hljs-string\">&quot;mk_YOUR_MIND_KEY_HERE&quot;</span>\n<span class=\"hljs-built_in\">export</span> SYNAPSE_URL=<span class=\"hljs-string\">&quot;https://synapse.schaefer.zone&quot;</span>  <span class=\"hljs-comment\"># optional, defaults to synapse.schaefer.zone</span></code></pre><h3>Method 2: Edit Config File</h3>\n<p>Edit <code>~/.claude/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><h2>Verify It Works</h2>\n<p>Start Claude Code:</p>\n<pre><code class=\"hljs language-bash\">claude</code></pre><p>In the Claude Code prompt, type:</p>\n<pre><code class=\"hljs language-plaintext\">recall all my memories</code></pre><p>Claude should call <code>memory_recall</code> and respond with your stored memories.</p>\n<h2>Common Patterns</h2>\n<h3>Project context persistence</h3>\n<p>At the start of a coding session:</p>\n<pre><code class=\"hljs language-plaintext\">recalling my memories — what projects am I working on?</code></pre><p>Claude calls <code>memory_recall</code>, sees your project list, and continues work\nwhere you left off.</p>\n<h3>Codebase decisions</h3>\n<p>When you make an architectural decision:</p>\n<pre><code class=\"hljs language-plaintext\">store this: &quot;We chose PostgreSQL over SQLite because of concurrent write\nperformance. Decision made on 2026-06-27.&quot;</code></pre><p>Claude calls <code>memory_store</code> with category <code>project</code>, priority <code>high</code>.</p>\n<h3>Avoiding past mistakes</h3>\n<pre><code class=\"hljs language-plaintext\">what mistakes have I made with this codebase?</code></pre><p>Claude searches memories with category <code>mistake</code> and reminds you of past errors.</p>\n<h3>Task tracking</h3>\n<pre><code class=\"hljs language-plaintext\">create a task: &quot;Refactor auth module to use JWT refresh tokens&quot;</code></pre><p>Claude calls <code>task_create</code>, and the task persists across sessions.</p>\n<h2>Tool Profiles</h2>\n<p>For coding sessions where you don&#39;t need all 119 tools:</p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Set profile via env var</span>\n<span class=\"hljs-built_in\">export</span> MCP_PROFILE=<span class=\"hljs-string\">&quot;standard&quot;</span>  <span class=\"hljs-comment\"># 25 tools, ~2500 tokens</span>\n\n<span class=\"hljs-comment\"># Or in config.json</span>\n<span class=\"hljs-string\">&quot;env&quot;</span>: {\n  <span class=\"hljs-string\">&quot;SYNAPSE_MIND_KEY&quot;</span>: <span class=\"hljs-string\">&quot;mk_...&quot;</span>,\n  <span class=\"hljs-string\">&quot;MCP_PROFILE&quot;</span>: <span class=\"hljs-string\">&quot;standard&quot;</span>\n}</code></pre><h2>Troubleshooting</h2>\n<h3>MCP server not starting</h3>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Test the MCP server manually</span>\nnpx -y synapse-mcp-api@latest\n\n<span class=\"hljs-comment\"># Should print:</span>\n<span class=\"hljs-comment\"># [info] synapse-mcp Streamable HTTP server ready</span>\n<span class=\"hljs-comment\"># [info]   MCP:      http://localhost:13100/mcp</span></code></pre><h3>Mind Key not recognized</h3>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Verify env var is set</span>\n<span class=\"hljs-built_in\">echo</span> <span class=\"hljs-variable\">$SYNAPSE_MIND_KEY</span>\n\n<span class=\"hljs-comment\"># Test directly</span>\ncurl -H <span class=\"hljs-string\">&quot;Authorization: Bearer <span class=\"hljs-variable\">$SYNAPSE_MIND_KEY</span>&quot;</span> \\\n     https://synapse.schaefer.zone/memory/recall</code></pre><h3>Claude Code doesn&#39;t see tools</h3>\n<ul>\n<li>Restart Claude Code after config changes</li>\n<li>Check <code>claude mcp list</code> to verify Synapse is registered</li>\n<li>See <a href=\"/docs/mcp/troubleshooting\">MCP Troubleshooting</a></li>\n</ul>\n<h2>Next Steps</h2>\n<ul>\n<li><a href=\"/docs/mcp/claude-desktop\">Claude Desktop Setup</a></li>\n<li><a href=\"/docs/mcp/cursor\">Cursor 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/claude-code","text":"/docs/mcp/claude-code?format=text","json":"/docs/mcp/claude-code?format=json","llm":"/docs/mcp/claude-code?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}