mcpField
C
codebase-synapse

codebase-synapse

Local
github.com/iwielsDeveloper Tools2Updated 13w ago

About codebase-synapse

codebase-synapse indexes a repository into a local knowledge graph, giving coding agents search, dependency analysis, and architecture information. It stores the index in SQLite and includes Git history analysis and cross-session memory tools.

Key features

  1. 01Semantic, full-text, and hybrid code search
  2. 02Traverse call graphs and dependencies
  3. 03Analyze impact and architectural boundaries
  4. 04Inspect Git history and change coupling
  5. 05Use persistent and session memory tools
  6. 06Block high-impact file writes with codebase-guard

Use cases

  1. 01Find callers and callees of a function
  2. 02Assess impact before editing a file
  3. 03Trace file history and co-changes
  4. 04Prepare code-edit context for an agent

MCP support

The stdio MCP server exposes code search, graph, architecture, Git history, and memory tools to MCP clients. The index is built separately with a CLI command; the server reads the existing local index.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"iwiels-codebase-synapse": {
"command": "npx",
"args": [
"-y",
"codebase-synapse"
]
}
}
}
Run commandnpx -y codebase-synapse

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmcodebase-synapse0.1.13

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

🧠 Codebase Synapse

Give your AI agent a deep understanding of your entire codebase.

An MCP server that indexes your codebase into a local knowledge graph with 52 AI tools — semantic search, call-graph traversal, git archaeology, blast-radius analysis, and more.


Codebase Synapse — Knowledge graph visualization

Works with Claude Code · Cursor · Windsurf · Zed · Any MCP client

CI npm version License: Apache-2.0 MCP Registry


The Problem

AI coding agents (Claude, Cursor, etc.) are powerful — but they work with limited context. They can only see the files you open or feed them. Ask about call chains, architectural patterns, or blast-radius impact, and they guess.

Codebase Synapse fixes this. It indexes your entire repo into a local knowledge graph stored in SQLite, giving your AI agent real answers backed by structural analysis — not hallucinations.

Codebase Synapse demo — indexing and impact analysis
How it works
graph LR
    A["📁 Your Codebase"] -->|Tree-sitter| B["🧩 Parser"]
    B -->|Symbols & Edges| C["🕸️ Knowledge Graph"]
    C -->|SQLite| D["💾 Local DB"]
    D -->|52 MCP Tools| E["🤖 AI Agent"]
    
    style A fill:#1a1b26,stroke:#7aa2f7,color:#c0caf5
    style B fill:#1a1b26,stroke:#bb9af7,color:#c0caf5
    style C fill:#1a1b26,stroke:#9ece6a,color:#c0caf5
    style D fill:#1a1b26,stroke:#e0af68,color:#c0caf5
    style E fill:#1a1b26,stroke:#f7768e,color:#c0caf5

⚡ Quick Start

1. Index your project (CLI, Zoekt-style)
codebase-synapse index /path/to/your/repo

Indexing runs as a separate CLI command and writes into ~/.codebase-synapse/codebase.db. The first index is the slow one; re-running it only re-indexes changed files. The MCP server never indexes — it only reads the pre-built index.

2. Start the MCP server
npx codebase-synapse

That's it. No Docker. No database setup. No cloud. The server starts via stdio and serves the pre-built index to your MCP client.

Configure your client
Claude Code / Claude Desktop

Add to your claude_desktop_config.json or mcp_servers.json:

{
  "mcpServers": {
    "codebase-synapse": {
      "command": "npx",
      "args": ["-y", "codebase-synapse"]
    }
  }
}
Cursor

Add to your .cursor/mcp.json:

{
  "mcpServers": {
    "codebase-synapse": {
      "command": "npx",
      "args": ["-y", "codebase-synapse"]
    }
  }
}
Other MCP clients

Any MCP client that supports stdio transport works. Just point it at:

npx -y codebase-synapse

✨ What It Does

🔍 Search & Discovery
ToolDescription
semantic_searchVector similarity search using local embeddings (all-MiniLM-L6-v2)
search_codeFull-text search across code (FTS5 + BM25 ranking)
search_symbolFind functions, classes, types by name or pattern
hybrid_searchCombined semantic + lexical search with RRF fusion
find_similarFind structurally similar code using MinHash + LSH
find_symbol_everywhereLocate a symbol across all indexed projects
🕸️ Knowledge Graph
ToolDescription
get_callers / get_calleesNavigate the call graph in either direction
get_imports / get_dependentsTrace dependency chains
impact_analysisCompute blast radius before editing a file
find_pathFind the shortest connection between two symbols
find_dead_codeDetect unreachable functions and unused exports
get_pagerankIdentify the most critical nodes in your architecture
query_graphRun Cypher-like queries against the knowledge graph
🏗️ Architecture
ToolDescription
get_architectureFull project architecture overview (languages, entry points, hotspots)
get_file_structureDirectory tree with symbol annotations
project_overviewHigh-level summary with key metrics
get_route_mapExtract HTTP routes and their handler mappings
suggest_boundariesDetect module boundaries via Leiden clustering
check_boundariesValidate cross-module dependencies against defined boundaries
get_clustersCommunity detection across the codebase
🔬 Git Archaeology
ToolDescription
git_archaeologyDeep history analysis of a file (authors, churn, evolution)
get_hotspotsFiles with highest complexity × change frequency
detect_change_couplingFiles that always change together
get_recent_semantic_changesSemantically meaningful recent changes
index_git_historyBuild temporal analysis from git log
🧠 Memory & Context
ToolDescription
memory_store / memory_search / memory_listPersistent notes, facts, and decisions across sessions
session_remember / session_recallShort-term memory within a session
get_contextBudgeted context preparation for AI agents
get_edit_contextFocused context for a specific file edit
get_working_setRecently accessed and modified files
manage_adrArchitecture Decision Records management
🛡️ Codebase Guard

Included as a bonus: codebase-guard is a PreToolUse hook for Claude Code that blocks writes to high-impact files until the agent runs impact_analysis first.

It uses PageRank scores and blast-radius data from the knowledge graph to identify architectural hubs. No more accidental edits to core files.

🔧 Technical Details

LanguageRust (compiled native binary)
TransportMCP stdio (JSON-RPC)
StorageSQLite (WAL mode, zero config)
Embeddingsall-MiniLM-L6-v2 via Candle (offline, local, lazy-loaded)
ParsingTree-sitter (10 languages)
Distributionnpm with prebuilt binaries (Windows, macOS, Linux × x64, arm64)
Supported Languages

Rust · Python · TypeScript · JavaScript · Go · Java · C# · PHP · C · C++

Architecture
src/
├── parser/       # Tree-sitter parsing & entity extraction
├── graph/        # Knowledge graph, PageRank, Leiden clustering
├── indexer/      # Repository indexing pipeline
├── search/       # BM25 full-text + vector cosine + hybrid RRF
├── embedding/    # Candle-based local embeddings (feature-gated)
├── memory/       # Persistent & session memory stores
├── mcp/          # MCP protocol transport + 52 tool handlers
├── git/          # Git archaeology, intent classification, hotspots
├── context/      # Budgeted context preparation for AI
├── cypher/       # Nom-based Cypher parser → SQL CTE planner
├── similarity/   # MinHash + LSH structural similarity
├── semantic/     # Multi-signal scoring (tokens, directory, AST)
└── cli/          # Interactive TUI installer + artifact export/import

🤝 Contributing

Contributions are welcome! The project uses standard Rust tooling:

# Run tests
cargo test

# Lint
cargo clippy -- -D warnings

# Format
cargo fmt --all

📄 License

Apache-2.0

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.