# Synapse MCP > Synapse MCP is a persistent, local code-knowledge graph server built in Elixir, operating over the Model Context Protocol (MCP). It converts any codebase into an Abstract Syntax Tree (AST) graph stored in ETS, giving AI coding agents (Claude Code, Cursor, Windsurf, Warp, Antigravity, Copilot, Zed) microsecond structural vision, 30–60% token savings, and zero-breakage refactoring capabilities. 100% local — your code never leaves your machine. ## Architecture & Engineering - [How Local Code Knowledge Graphs Work — Inside the Microsecond BEAM Engine](https://synapse-mcp.dev/blog/how-local-code-knowledge-graphs-work.html): Elixir architecture deep dive — 12 ETS tables as the in-memory graph store, one GenServer per repo under a DynamicSupervisor, pure Elixir BM25F embeddings at 10–50µs per chunk, Shadow Graph safe writes, the :persistent_term literal allocator crash, and cross-repo edge resolution. - [Why Synapse MCP Beats Native IDE Indexers](https://synapse-mcp.dev/blog/why-synapse-mcp-beats-native-ide-indexers.html): How Cursor's Merkle Trees, Windsurf's semantic vector index, and Warp's git worktree grounding compare to a local AST graph. Staleness, vendor lock-in, and why vectors guess where compilers know. - [Why AI Coding Agents Need AST Knowledge Graphs, Not Vector Embeddings](https://synapse-mcp.dev/blog/why-ai-agents-need-ast-graphs-not-vectors.html): Vector RAG chops functions in half and misses alias imports. AST graphs preserve exact structure for reliable agent refactors. - [Codebase Context Engines Compared (2026)](https://synapse-mcp.dev/blog/codebase-context-engines-compared.html): Side-by-side comparison of Augment Code, Greptile, CocoIndex, Sourcegraph, and Synapse MCP — cloud RAG vs vector search vs local AST graphs. ## Benchmarks - [2ms vs. 12 Seconds: AST Graph Benchmark](https://synapse-mcp.dev/blog/2ms-vs-12-seconds-the-ast-graph-benchmark.html): 9 sequential grep/read calls (12.4 seconds, 8,400 tokens) vs 1 Synapse graph query (2ms, 3,660 tokens). 6,200× faster, 56.4% token savings. - [Three-Arm Benchmark: Synapse vs codebase-memory-mcp vs Shell](https://synapse-mcp.dev/blog/three-arm-benchmark-synapse-vs-codebase-memory-vs-shell.html): Full session: 177K tokens (shell) vs ~71K (Synapse) — 60% savings, 2.2× faster, half the tool calls. Total session cost is what matters. - [Synapse vs Graphify — Live Head-to-Head Benchmark](https://synapse-mcp.dev/blog/synapse-vs-graphify-live-benchmark.html): Physical benchmarks on the same hardware including torvalds/linux at 74,619 files. Synapse: 37.5× faster discovery, 5.9× lower RAM, 400× faster cold queries, 9.7–15.2× fewer tokens. - [The Graph Drift Problem Is Real. Graphify Still Can't Fix It.](https://synapse-mcp.dev/blog/the-graph-drift-problem-is-real-graphify-cant-fix-it.html): Response to a Medium article on production Graphify setups. Why observability hooks can't fix stale knowledge graphs when the architecture guarantees drift — and what an in-memory live-index design does differently. - [Karpathy's LLM Wiki vs. Synapse MCP: Why Code Needs a Graph, Not Prose](https://synapse-mcp.dev/blog/synapse-karpathy-and-the-code-graph.html): Karpathy's wiki is brilliant for prose —but code isn't prose. Against his LLM Wiki [gist](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) we keep the code itself as the source of truth with a live, read-write knowledge graph. - [How Do AI Agents Spend Your Money?](https://synapse-mcp.dev/blog/how-do-ai-agents-spend-your-money.html): Agentic coding tasks consume 1,000× more tokens than standard reasoning. Breakdown of why input token bloat dominates agent costs and how precision retrieval, AST outlines, and SmartCrusher tackle each root cause. ## Refactoring & Best Practices - [Stop Letting AI Hallucinate Refactors](https://synapse-mcp.dev/blog/stop-letting-ai-hallucinate-refactors.html): Why AI agents waste 70% of session time re-reading files, the 12-turn discovery loop, silent breakage from missed aliased imports, and how microsecond caller/callee graphs eliminate it. - [Why LLMs Code Better with Knowledge Graphs](https://synapse-mcp.dev/blog/why-llms-code-better-with-knowledge-graphs.html): Real R&D data showing 30–60% token savings, false confidence elimination, and multi-app refactoring with AST-backed caller/callee graphs. - [We Caught Our AI Lying About a Tool Call](https://synapse-mcp.dev/blog/we-caught-our-ai-lying-about-a-tool-call.html): A real incident transcript showing how agents claim tool success without evidence — and the grounding policies that stop it. ## Pricing & Industry - [Why Synapse Pro is $19/month](https://synapse-mcp.dev/blog/why-synapse-pro-is-19-a-month.html): The 2026 AI developer tooling landscape — Cursor, Windsurf, Devin, Warp, Claude Pro. Why $20/mo is the universal price anchor and how Synapse pays for itself in token savings. ## Key Capabilities - **Microsecond Graph Traversal:** Local ETS lookups resolve caller and callee edges in 12 microseconds. No network round-trip, no database I/O. - **Payload Compression (SmartCrusher):** Minifies JSON responses, relativises paths, strips null fields, shortens structural keys. 30–60% token savings with zero information loss. - **In-Memory Safe Writes (`write_safely`):** Stages edits in memory, checks caller signatures against the graph, runs linter validation. Auto-rolls back if anything would break before touching disk. - **Shadow Graph:** Builds an ephemeral graph from proposed edits, diffs against baseline ETS chunks, returns compilation errors, contract warnings, and blast radius. All in-memory, all in Elixir. - **Crash Stack Trace Resolution (`resolve_stack`):** Parses runtime stack frames, matches to indexed AST chunks, resolves call graphs, pinpoints root cause. - **Virtual Worktree Overlay (VWO):** Sub-50ms delta indexes for Git worktrees — parallel agents without duplicating memory. - **Cross-Repo Edge Resolution:** Resolves function calls across repository boundaries using a global ETS symbol index. - **Native Elixir Embeddings:** BM25F + random projection in pure Elixir — 256-dim vectors, 10–50µs per chunk, zero NIFs, zero external API, zero Python runtime. - **100% Local Data Sovereignty:** Runs entirely as a local binary. Zero source code or telemetry leaves your hardware. ## Installation - **Download:** https://synapse-mcp.dev/download — binary for macOS (.dmg), Windows (.msi), Linux (.deb, .rpm, .AppImage). Auto-detects IDE and registers agent rules. - **Free Edition ("Golden Graph" — $0):** Full AST indexing across 50+ languages, 3 search modes (symbol, regex, semantic), context retrieval, file inspection, standard writes, unlimited repositories. - **Pro Edition ("Shadow Graph" — $19/mo or $190/yr):** Everything in Free, plus deep graph exploration (callers/callees/cycles), simulated safe writes, crash stack trace resolution, test coverage analysis, persistent encrypted knowledge cache, and change review with blast radius analysis. ## Tech Stack - Elixir umbrella app (3 OTP apps: synapse_core, synapse_mcp, synapse_pro) - ETS for all hot-path graph reads (12 named tables, lock-free reads, serialised writes) - Ecto + SQLite with SQLCipher for durable encrypted storage - Burrito for cross-platform binary packaging (macOS, Linux, Windows) - Pure Elixir BM25F embeddings (no Python, no Nx, no external ML runtime) - Tree-sitter via NIF for AST parsing across 50+ languages - OTP 27, BEAM