# MCP in Claude Code Claude Code is Anthropic's terminal-based coding agent. With Synapse MCP, Claude Code gains persistent memory across coding sessions — it remembers your project context, past decisions, and codebase patterns. ## Setup ### Method 1: CLI Command (recommended) ```bash # Add Synapse as an MCP server claude mcp add synapse -- npx -y synapse-mcp-api@latest # Set your Mind Key as env var (add to ~/.bashrc or ~/.zshrc) export SYNAPSE_MIND_KEY="mk_YOUR_MIND_KEY_HERE" export SYNAPSE_URL="https://synapse.schaefer.zone" # optional, defaults to synapse.schaefer.zone ``` ### Method 2: Edit Config File Edit `~/.claude/config.json`: ```json { "mcpServers": { "synapse": { "command": "npx", "args": ["-y", "synapse-mcp-api@latest"], "env": { "SYNAPSE_MIND_KEY": "mk_YOUR_MIND_KEY_HERE", "SYNAPSE_URL": "https://synapse.schaefer.zone" } } } } ``` ## Verify It Works Start Claude Code: ```bash claude ``` In the Claude Code prompt, type: ``` recall all my memories ``` Claude should call `memory_recall` and respond with your stored memories. ## Common Patterns ### Project context persistence At the start of a coding session: ``` recalling my memories — what projects am I working on? ``` Claude calls `memory_recall`, sees your project list, and continues work where you left off. ### Codebase decisions When you make an architectural decision: ``` store this: "We chose PostgreSQL over SQLite because of concurrent write performance. Decision made on 2026-06-27." ``` Claude calls `memory_store` with category `project`, priority `high`. ### Avoiding past mistakes ``` what mistakes have I made with this codebase? ``` Claude searches memories with category `mistake` and reminds you of past errors. ### Task tracking ``` create a task: "Refactor auth module to use JWT refresh tokens" ``` Claude calls `task_create`, and the task persists across sessions. ## Tool Profiles For coding sessions where you don't need all 119 tools: ```bash # Set profile via env var export MCP_PROFILE="standard" # 25 tools, ~2500 tokens # Or in config.json "env": { "SYNAPSE_MIND_KEY": "mk_...", "MCP_PROFILE": "standard" } ``` ## Troubleshooting ### MCP server not starting ```bash # Test the MCP server manually npx -y synapse-mcp-api@latest # Should print: # [info] synapse-mcp Streamable HTTP server ready # [info] MCP: http://localhost:13100/mcp ``` ### Mind Key not recognized ```bash # Verify env var is set echo $SYNAPSE_MIND_KEY # Test directly curl -H "Authorization: Bearer $SYNAPSE_MIND_KEY" \ https://synapse.schaefer.zone/memory/recall ``` ### Claude Code doesn't see tools - Restart Claude Code after config changes - Check `claude mcp list` to verify Synapse is registered - See [MCP Troubleshooting](/docs/mcp/troubleshooting) ## Next Steps - [Claude Desktop Setup](/docs/mcp/claude-desktop) - [Cursor Setup](/docs/mcp/cursor) - [Persistent LLM Agent Guide](/docs/guides/persistent-llm-agent)