Overview
codebase-memory-mcp is a code intelligence engine for AI coding agents. It parses a repository into a persistent knowledge graph of functions, classes, call chains, HTTP routes and cross-service links, then exposes that graph to an agent through 15 MCP tools — search, trace, architecture, impact analysis, index-coverage checks, Cypher queries, dead-code detection, cross-service HTTP linking and ADR management among them.
The point is to replace file-by-file exploration. When an agent has to answer "what calls this function" by grepping and reading, it burns a large fraction of its context on files it will discard. Querying a precomputed graph collapses that into a structured answer: the project reports five structural queries costing roughly 3,400 tokens where file-by-file search costs about 412,000, and its preprint (arXiv:2603.27277, evaluated across 31 real-world repositories) reports 83% answer quality with 10x fewer tokens and 2.1x fewer tool calls than file-by-file exploration.
Parsing is tree-sitter AST analysis across 162 languages, with grammars vendored and compiled into the binary so there is nothing to install per language. For Python, TypeScript/JavaScript/JSX/TSX, PHP, C#, Go, C, C++, Java, Kotlin, Rust and Perl, a Hybrid LSP layer adds semantic type resolution on top. It ships as a pure-C native executable for macOS (arm64/amd64), Linux (arm64/amd64) and Windows (amd64) — no Docker, no language runtime, no API key — and the installer configures detected agent clients across 45 supported surfaces. All processing is local; a built-in 3D graph visualisation is served from the binary itself at localhost:9749. Because the tool reads your codebase and writes to your agent configuration files, review the repository's SECURITY.md before running the install script.
What it does
- Persistent knowledge graph of functions, classes, call chains, HTTP routes and cross-service links
- 15 MCP tools covering search, trace, architecture, impact analysis, Cypher queries, dead-code detection and ADR management
- 162 languages via vendored tree-sitter grammars, plus Hybrid LSP semantic type resolution for 12 of them
- Fast full indexing — the project reports the Linux kernel (28M LOC, 75K files) in 3 minutes and sub-millisecond structural queries
- Native executable for macOS, Linux and Windows with no Docker, language runtime or API key; processing stays on your machine
- Installer configures detected agent clients across 45 supported surfaces, and a built-in 3D graph UI runs at localhost:9749
- Infrastructure-as-code indexing: Dockerfiles, Kubernetes manifests and Kustomize overlays become graph nodes with cross-references
Getting started
Installation is a single script that fetches the release binary and wires up your detected agent clients. The script reads your codebase and writes to agent configuration files by design — the full source is on GitHub if you would rather audit it first.
Install on macOS or Linux
Run the one-line installer from the repository.
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bashInstall on Windows
Download the PowerShell installer, inspect it, unblock it (browsers and Invoke-WebRequest add a Mark-of-the-Web restriction), then run it.
# 1. Download the installer
Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1
# 2. (Optional but recommended) Inspect the script
notepad install.ps1
# 3. Unblock the downloaded file
Unblock-File .\install.ps1
# 4. Run it
.\install.ps1Restart your agent and index
The install step configures the agent clients it detects and activates conditional clients only when their documented platform, marker or existing config path is present. Restart the agent afterwards so it picks up the new MCP server and its tools.
Explore the graph
The binary serves an interactive 3D visualisation of the knowledge graph so you can see what the agent is querying.
http://localhost:9749Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Cut an agent's token spend on a large repository by answering structural questions from a graph instead of reading files
- Run impact analysis before a refactor — trace every caller and cross-service HTTP link that a change would touch
- Give a coding agent a working map of an unfamiliar polyglot codebase without per-language tooling setup
- Find dead code, or query the graph directly with Cypher, across a repository of any supported language
How codebase-memory-mcp compares
codebase-memory-mcp alongside other open-source code indexing & search tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| CodeGraph | ★ 74.3k | Builds a local SQLite knowledge graph of a codebase with a Rust tree-sitter kernel, keeps it in sync through a file watcher, and serves symbols, call paths and blast radius to coding agents over MCP. |
| GitNexus | ★ 47.9k | Indexes a codebase into a knowledge graph of dependencies, call chains and execution flows, then exposes it to Claude Code, Cursor and Codex through MCP tools. |
| codebase-memory-mcp | ★ 46.7k | Tree-sitter knowledge graph of your codebase, served to agents over MCP |
| code-review-graph | ★ 32.2k | A local-first code intelligence graph built with Tree-sitter that serves precise, incrementally-updated structural context to AI coding tools over MCP, so they read only the code a task needs. |
| Claude Context | ★ 12.6k | An MCP server that indexes your codebase into a vector database so AI coding agents can find relevant code by meaning instead of loading whole folders. |
| Graft | ★ 10.2k | Builds a persistent knowledge graph of your codebase as linked markdown files, then feeds the matching nodes to coding agents so they stop re-exploring the repo on every task. |
| XERJ | ★ 7k | Single-binary, Elasticsearch-compatible search engine whose autoindex command turns any folder of code, docs, logs or PDFs into typed indices that AI coding agents query via CLI or MCP instead of grepping. |
| Semble | ★ 6.2k | A CPU-only code search library and MCP server that indexes a repository with tree-sitter chunking, Model2Vec embeddings and BM25, so an agent retrieves the few relevant snippets instead of grepping and reading whole files. |