The fastest and most efficient code intelligence engine for AI coding agents. Full-indexes an average repository in milliseconds, the Linux kernel (28M LOC, 75K files) in 3 minutes. Answers structural queries in under 1ms. Ships as a single static binary for macOS, Linux, and Windows — download, run install, done.
High-quality parsing through tree-sitter AST analysis across all 158 languages, enhanced with Hybrid LSP semantic type resolution for Python, TypeScript / JavaScript / JSX / TSX, PHP, C#, Go, C, C++, Java, Kotlin, and Rust — producing a persistent knowledge graph of functions, classes, call chains, HTTP routes, and cross-service links. 14 MCP tools. Zero dependencies. Plug and play across 11 coding agents.
Research — The design and benchmarks behind this project are described in the preprint Codebase-Memory: Tree-Sitter-Based Knowledge Graphs for LLM Code Exploration via MCP (arXiv:2603.27277). Evaluated across 31 real-world repositories: 83% answer quality, 10× fewer tokens, 2.1× fewer tool calls vs. file-by-file exploration.
Security & Trust — This tool reads your codebase and writes to your agent configuration files. That is what it is designed to do. If you prefer to audit before running, the full source is here — every release binary is signed, checksummed, and scanned by 70+ antivirus engines. All processing happens 100% locally; your code never leaves your machine. Found a security issue? We want to know — see SECURITY.md. Security is Priority #1 for us.

Built-in 3D graph visualization (UI variant) — explore your knowledge graph at localhost:9749
install → restart agent → done.install auto-detects Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, VS Code, OpenClaw, and Kiro — configures MCP entries, instruction files, and pre-tool hooks for each.localhost:9749 (optional UI binary variant).Resource nodes for K8s kinds, Module nodes for Kustomize overlays with IMPORTS edges to referenced resources.One-line install (macOS / Linux):
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
With graph visualization UI:
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --ui
Windows (PowerShell):
# 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. Run it
.\install.ps1
Options: --ui (graph visualization), --skip-config (binary only, no agent setup), --dir=<path> (custom location).
Restart your coding agent. Say "Index this project" — done.
Manual install
codebase-memory-mcp-<os>-<arch>.tar.gz (macOS/Linux) or .zip (Windows) — standardcodebase-memory-mcp-ui-<os>-<arch>.tar.gz / .zip — with graph visualization
Extract and install (each archive includes install.sh or install.ps1):
macOS / Linux:
bash
tar xzf codebase-memory-mcp-*.tar.gz
./install.sh
Windows (PowerShell):
powershell
Expand-Archive codebase-memory-mcp-windows-amd64.zip -DestinationPath .
.\install.ps1
The install command automatically strips macOS quarantine attributes and ad-hoc signs the binary — no manual xattr/codesign needed.
The install command auto-detects all installed coding agents and configures MCP server entries, instruction files, skills, and pre-tool hooks for each.
If you downloaded the ui variant:
codebase-memory-mcp --ui=true --port=9749
Open http://localhost:9749 in your browser. The UI runs as a background thread alongside the MCP server — it's available whenever your agent is connected.
Enable automatic indexing on MCP session start:
codebase-memory-mcp config set auto_index true
When enabled, new projects are indexed automatically on first connection. Previously-indexed projects are registered with the background watcher for ongoing git-based change detection. Configurable file limit: config set auto_index_limit 50000.
codebase-memory-mcp update
The MCP server also checks for updates on startup and notifies on the first tool call if a newer release is available.
codebase-memory-mcp uninstall
Removes all agent configs, skills, hooks, and instructions. Does not remove the binary or SQLite databases.
get_architecture returns languages, packages, entry points, routes, hotspots, boundaries, layers, and clusters in a single callmanage_adr persists architectural decisions across sessionsdetect_changes maps uncommitted changes to affected symbols with risk classificationMATCH (f:Function)-[:CALLS]->(g) WHERE f.name = 'main' RETURN g.namesemantic_query): vector search across the entire graph, powered by bundled Nomic nomic-embed-code embeddings (40K tokens, 768d int8) compiled into the binary — no API key, no Ollama, no Docker. 11-signal combined scoring (TF-IDF, RRI, API/Type/Decorator signatures, AST profiles, data flow, Halstead-lite, MinHash, module proximity, graph diffusion).cbm_camel_split tokenizer (camelCase / snake_case aware)search_graph): regex name patterns, label filters, min/max degree, file scopingsearch_code): graph-augmented grep over indexed files onlyEMITS / LISTENS_ON) for Socket.IO, EventEmitter, and generic pub-sub patterns across 8 languages with constant resolutionCROSS_* edges link nodes across multiple repos indexed under the same storeCALLS, IMPORTS, DEFINES, IMPLEMENTS, INHERITSHTTP_CALLS, ASYNC_CALLS (cross-service)EMITS, LISTENS_ON (channels)DATA_FLOWS with arg-to-param mapping + field access chainsSIMILAR_TO (MinHash + LSH near-clone detection, Jaccard scored)SEMANTICALLY_RELATED (vocabulary-mismatch, same-language, score ≥ 0.80)@myorg/pkg, github.com/foo/bar, use my_crate::foo resolved via manifest scanning (package.json, go.mod, Cargo.toml, pyproject.toml, composer.json, pubspec.yaml, pom.xml, build.gradle, mix.exs, *.gemspec)~/.cache/codebase-memory-mcp/codebase-memory-mcp cli search_graph '{"name_pattern": ".*Handler.*"}'go installCommit a single compressed file to your repo and your teammates skip the reindex.
.codebase-memory/graph.db.zst is a zstd-compressed snapshot of the knowledge graph that lives next to your source. When you index, the artifact is written or refreshed; when a teammate clones the repo and runs codebase-memory-mcp for the first time, the artifact is decompressed and incremental indexing fills in their local diff.
VACUUM INTO compacted, then zstd 1.5.7 compressed (8–13:1 ratio typical)zstd -9 + index strip + VACUUM INTO) — written on explicit index_repositoryzstd -3) — written by the watcher for low-latency incremental updatesindex_repository imports the artifact first, then runs incremental indexing — avoiding the full reindex cost.gitattributes line with merge=ours is auto-created on first export, so concurrent edits don't produce conflicts on the binary artifact.codebase-memory/ to .gitignore if you prefer everyone to reindex from scratch.The result is similar in spirit to graphify's graphify-out/ directory, but as a single compressed file with explicit two-tier export, integrity-checked import, and zero merge friction.
codebase-memory-mcp is a structural analysis backend — it builds and queries the knowledge graph. It does not include an LLM. Instead, it relies on your MCP client (Claude Code, or any MCP-compatible agent) to be the intelligence layer.
``` You
$ claude mcp add codebase-memory-mcp \
-- python -m otcore.mcp_server <graph>