When an AI coding agent works on a large repo, most of its budget goes to looking around. It greps, reads a file, greps again, opens three more files, and burns thousands of tokens reconstructing what a call graph already knows. codebase-memory-mcp attacks that step directly: it builds a persistent graph of your code once, then answers structural questions (who calls this, what does this import, what breaks if I change it) over MCP, so the agent queries the graph instead of re-reading files.

It is written in C and ships as a single static binary with no runtime dependencies, no Docker, and no API key. That is the first thing worth flagging, because it shapes everything else about how the project feels.

What it actually does

The server parses your code with tree-sitter across 158 languages and stores the result in SQLite as a graph of functions, classes, routes, imports, and call edges. On top of the syntactic tree-sitter pass it runs a second “Hybrid LSP” pass for 11 languages (Python, TypeScript/JavaScript, Go, Rust, Java, Kotlin, C, C++, C#, PHP) that resolves types, generics, and inheritance so a call like user.profile.display_name() resolves to the real method three modules away by tracking types, instead of guessing from the name.

There is no LLM inside it. The design assumes your MCP client (Claude Code, Codex, Gemini CLI, and others) is already the language model, so the binary stays a pure structural backend that exposes 14 tools: graph search, call-path tracing, a read-only openCypher subset, git-diff impact mapping, dead-code detection, and an architecture overview. That choice is the right one for an MCP tool, and it keeps the binary small and offline.

Why it is getting attention

The pitch is speed and token thrift, and the numbers in the README are large: the Linux kernel (28M lines, 75K files) indexed in about three minutes, Cypher queries under a millisecond, and five structural queries costing roughly 3,400 tokens against about 412,000 for the equivalent file-by-file exploration. Treat these as the author’s own benchmarks, measured on an Apple M3 Pro and described in a project preprint. They are plausible for graph lookups versus repeated grep, but you should expect your own mileage to depend on how your agent is prompted to use the tools, not just on raw query latency.

The genuinely useful trick is the team-shared graph artifact: indexing writes a zstd-compressed .codebase-memory/graph.db.zst next to your source, and a teammate who clones the repo imports that snapshot and only re-indexes their local diff. A merge=ours gitattribute is added automatically so the binary blob never causes merge conflicts. For a large monorepo where a cold index is the cost, that is a real workflow win.

Install

The one-line installers (read the script first if you care, it writes to your agent config):

# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
# Windows
Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1
.\install.ps1

Package managers also carry it: Homebrew, Scoop, Winget, Chocolatey, AUR (yay -S codebase-memory-mcp-bin), npm, PyPI, and go install. After install, restart your agent and say “Index this project”. The install command auto-detects installed agents and wires MCP entries, instruction files, and hooks for each.

The honest caveats

This is the part the README will not lead with.

It is young. The repo was created in February 2026 and crossed 8,000 stars fast (as of 2026-06), so you are adopting a fast-moving tool whose versions still shift week to week. Read the release notes before pinning a version.

What the agent config install touches matters. The tool both reads your codebase and writes to your agent configuration files, and on Claude Code it installs a PreToolUse hook that intercepts Grep/Glob to inject graph context. The maintainers say hooks are non-blocking by design, but a tracked issue reported that the v0.7.0 installer wired a legacy blocking gate instead of the augmenting one. If your agent’s search behavior changes after install, that hook is the first place to look.

Two more real limits surface in the issue tracker. The 3D graph visualization can freeze the browser on repos above roughly 10K nodes, so the UI is best kept for demos; large graphs choke it. And Rust cross-crate call graphs can stop at crate boundaries, which matters if your reason for installing this is whole-workspace tracing in a multi-crate project. Both are open at the time of writing.

Alternatives

ProjectStarsLangTake
DeusData/codebase-memory-mcp~8.4kCSingle binary, 158 langs, graph + Hybrid LSP types, no LLM
safishamsi/graphifysee pagen/aThe README cites it directly; closest in spirit, indexes to a graphify-out/ directory
colbymchenry/codegraphsee pagen/aAnother code-graph approach for agents
mem0ai/mem0see pagePythonAgent memory layer, a different problem from code structure

If you want the same idea applied to general agent memory rather than code structure, mem0 is the comparison; for the same code-graph idea, graphify is the one the project itself names.

FAQ

Is codebase-memory-mcp free? Yes. It is MIT licensed and open source, with no API key or paid tier. All indexing runs locally and your code stays on your machine.

Does it need an LLM or API key to run? No. It is a structural backend with no built-in model. The intelligence comes from your MCP client (Claude Code, Codex, Gemini CLI), so there is nothing extra to configure or pay for.

How is it different from just letting my agent grep? Grep re-reads files on every question and pays tokens each time. This indexes once into a graph and answers structure questions (callers, call paths, impact of a diff) as cheap lookups. The benefit grows with repo size and with how often you ask structural questions.

Does it work on Windows, and is it safe to install? It supports macOS, Linux, and Windows as a static binary, with SmartScreen warnings expected on Windows for unsigned software. Releases publish checksums and provenance. Note that install writes to your agent config and adds a hook, so read the installer if that matters to you.

Is it production-ready? It is fast and feature-rich but new (created early 2026) and still churning, with open issues around large-graph UI and Rust cross-crate resolution. Fine to adopt for indexing and querying; pin a version and watch the changelog.