The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Synapse Code MCP listing page.
A structural code context server that connects your local repository to AI assistants via the Model Context Protocol.
Instead of copy-pasting files into a prompt, Synapse lets your AI assistant dynamically explore your codebase — pulling only the code it needs, when it needs it. The result: less context waste, smarter answers, and a workflow that scales to large projects — with no vector database or embedding API to set up.
Status: Early-stage, actively developed. Contributions and bug reports are welcome — see Contributing.
Most AI coding tools already index files. Synapse solves a different problem: context quality at scale.
| Problem | Synapse solution |
|---|---|
| Reading an entire file when you only need its API surface | get_semantic_context with outline_only — signatures only, ≤ 50% of full content |
| AI doesn't know what files exist in an unfamiliar project | get_project_index — full symbol map at ≤ 40% of raw source size, one call |
| "Review my changes" requires pasting the diff manually | get_changed_files — structured git diff, git-aware by default |
| Dependency rabbit holes filling the context window | Configurable depth cap on import traversal |
The compression ratios above are enforced as automated test budgets — not marketing estimates.
Most code-context MCP servers use semantic search backed by a vector database (e.g. Milvus, Qdrant) and an embedding API (OpenAI, VoyageAI). That gives them a real capability Synapse doesn't have: finding code by conceptual meaning ("find the authentication logic") rather than by structure or text.
Synapse trades that capability for a different set of properties:
If you need natural-language semantic search across millions of lines in many languages, a vector-backed server is the better tool. If you want structural context (signatures, dependency graphs, diffs) without standing up infrastructure, Synapse is built for that.
get_project_indexReturns a compressed semantic map of the entire project: all exported functions, classes, interfaces, types, enums, and top-level constants with their signatures — no bodies. The right first call when exploring an unfamiliar codebase.
Parameters: file_pattern (glob to narrow scope), include_non_exported, output_format ("markdown" default · "json" for structured output)
Use output_format: "json" to get the raw symbol data as a structured object, which is easier to post-process programmatically:
Large projects: output grows linearly with the number of exported symbols. For monorepos or projects with 500+ files, use
file_patternto scope the index to one area at a time — e.g."src/services/**/*.ts".
get_semantic_contextReturns a file's content alongside its local dependency graph — everything the AI needs to understand the code in context.
Add outline_only: true to get signatures without implementation bodies. Output is enforced by the benchmark suite to be ≤ 50% of full content length, while preserving full structural understanding.
Parameters: file_path (required), depth (import hops, default: 2), outline_only, output_format ("markdown" default · "json" for structured output)
get_changed_filesLists files changed since a git ref, grouped by status (Added / Modified / Deleted / Renamed), with optional line counts and full unified diff.
Parameters: base_ref (default: HEAD~1), include_diff, file_pattern
get_project_treeStructured view of the repository, respecting .gitignore rules.
Parameters: path, max_depth, show_hidden
search_codebaseFast text or regex search across the project, returning matches with file paths and line numbers. Uses ripgrep when available, falls back to a pure Node.js scanner.
Parameters: query (required), file_pattern, is_regex, max_results
Synapse uses ts-morph (TypeScript compiler API) for deep analysis of TypeScript and JavaScript. For other languages, it applies regex-based extraction of function and class names.
| Feature | TypeScript / JS | Python · Go · Rust | Other |
|---|---|---|---|
get_project_tree | ✓ | ✓ | ✓ |
search_codebase | ✓ | ✓ | ✓ |
get_semantic_context — full source | ✓ | ✓ | ✓ |
get_semantic_context — dependency graph | ✓ | — | — |
get_semantic_context outline_only | ✓ full signatures | ✓ names only | — |
get_project_index | ✓ full signatures | ✓ names only | — |
Dependency graph traversal (following import/require chains) is TypeScript/JavaScript only. For all other languages, Synapse still reads and searches files normally — it just won't walk the import graph.
Note: dependency graph traversal follows both relative imports (
./foo,../bar) and path aliases configured viatsconfig.jsoncompilerOptions.paths(e.g.@/components/Foo), as long as atsconfig.jsonis present at the project root. Projects without atsconfig.jsonfall back to relative-only resolution.
Global install (recommended):
Run without installing:
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Or add directly to ~/.claude/settings.json:
Add to .cursor/mcp.json in your home directory or project root:
Add to ~/.codeium/windsurf/mcp_config.json:
Tip: Replace
/path/to/your/projectwith the absolute path to the repository you want to serve. You can run multiple Synapse instances — one per project — each with a different key undermcpServers.
Drop a synapse.config.json at your project root to override defaults for that project:
cacheEnabled (default true) controls the on-disk incremental index cache (.synapse-cache/index.json) used by get_project_index and get_semantic_context to skip re-parsing unchanged files. Set to false to disable it.
All fields are optional. CLI flags take precedence over synapse.config.json.
Measured on real open-source TypeScript repositories (single run, --depth 1 clone, no warm cache):
| Repository | Files indexed | Time | Heap growth |
|---|---|---|---|
| zod | 55 | 120 ms | 3 MB |
TypeScript compiler src/ | 247 | 257 ms | 24 MB |
The automated benchmark suite enforces upper bounds on a synthetic fixture (3 000 minimal .ts files) to catch regressions under worst-case conditions:
| Operation | CI budget (synthetic fixture) |
|---|---|
get_project_tree — 3 000 files | 5 s |
get_semantic_context — depth 3 | 10 s |
get_changed_files | 2 s |
get_project_index — 60 files | 30 s |
get_project_index — 600 files | 120 s |
The CI budgets are deliberately generous safety margins, not performance estimates — they exist to catch catastrophic regressions (e.g. an accidental O(n²) bug), not to predict real-world timing. The real-repo numbers above are the meaningful reference for expected performance. For large monorepos (1 000+ files), use file_pattern to scope the index to one area at a time.
Synapse is a read-only server. It never writes to the filesystem or modifies the git repository.
resolveAndValidate(root, path), which throws a PATH_ESCAPE error if the resolved path escapes the project root. The AI client receives the error code, never the file contents.--root is accessible. Paths pointing outside (e.g. ../../etc/passwd) are rejected at the validation layer.maxFileSize (default 512 KB) are rejected before reading.Explore a new codebase:
Code review before a PR:
Debug a feature:
get_changed_filesrg is not on $PATHThis opens a browser UI where you can invoke all tools interactively and inspect their input/output.
See ROADMAP.md for what is planned and what ideas are open for community contributions.
This project is in active early development. Bug reports, feature requests, and pull requests are all welcome — the codebase is intentionally small and straightforward to navigate.
New to the project? Browse issues tagged good first issue for the best entry points.