Codebase Memory MCP

Gives coding agents a queryable map of your repo instead of endless grep-and-read loops

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

Category
Developer tools
Audience
Developers
Language
C
Licence
MIT

Updated

Codebase Memory MCP is a code intelligence server that indexes a repository into a persistent knowledge graph and serves it to AI coding agents over the Model Context Protocol. It is built for developers who already work with an agent such as Claude Code, Cursor, Windsurf, Aider, Codex, Gemini CLI, opencode or Kilo Code, and who watch that agent spend thousands of tokens opening files one at a time to answer questions about structure that an index could answer in a single call.

What it does

The server parses your codebase down to its parts — functions, classes and the call chains between them — and stores the result as a graph the agent can query. Instead of a chain of grep, list and read calls, the agent asks one structural question and gets one answer. The project claims up to 99% fewer tokens spent on that kind of lookup.

Speed is the other half of the pitch. The README says an average repository is fully indexed in milliseconds and the Linux kernel, at 28 million lines across 75,000 files, in about three minutes. Structural queries are said to return in under a millisecond. Language coverage is broad: the project description and the video both say 158 languages, while a README badge lists 162.

A few other things ship in the same binary:

  • A hybrid LSP mode covering ten languages, for richer resolution than parsing alone.
  • A live 3D rendering of the codebase graph, which is what the video demonstrates alongside the indexing run.
  • A set of agent surfaces — the README badge counts 45 — that agents call into.

How it works

The engine is written in pure C with no language runtime behind it, and ships as a single static executable with no dependencies to install. Builds are published for macOS, Linux and Windows. The repository's topics point at the pieces underneath: Tree-sitter for parsing, SQLite for the persistent store, and Cypher for querying the graph. Because the index is persistent, the parsing cost is paid once rather than on every agent session.

The project pays unusual attention to supply chain and verification for a tool of this size. The README carries an OpenSSF Scorecard badge, SLSA level 3 provenance, a note that every release is scanned by VirusTotal, a test badge reading 8,050 passing, and a link to an arXiv paper describing the work. The license is MIT.

Getting started

Releases are published on GitHub for all three desktop platforms, and since the deliverable is one static binary there is nothing to install around it: fetch the executable for your machine, then register it as an MCP server in whichever agent client you use. The topic list suggests the maintainers have tested it against most of the popular ones. From there the agent discovers the server's tools the way it discovers any other MCP server, and your first indexing run builds the graph.

When to use it / when not

This earns its place when the codebase is large enough that navigation is genuinely expensive — many files, deep call chains, unfamiliar territory — and when you run agents against it often enough for the token savings to compound. A monorepo that your team's agents crawl several times a day is the obvious case.

It is less compelling on a small project where the agent can hold the whole tree in context anyway, and the setup step buys you little. It also answers structural questions specifically: what calls what, where a symbol is defined, how a chain flows. Questions about intent, prose documentation or design rationale are not the kind a graph of functions and call edges is shaped to answer. And if your tooling does not speak the Model Context Protocol, none of this reaches you.

Alternatives

The default alternative is the agent's own file tools — grep, glob and read — which need no setup at all and cost tokens on every question. The other common approach is an embedding index over the source, which answers fuzzy natural-language queries well but is vaguer about exact structure than a parsed graph. Per-language language servers give precise answers too, one language at a time and one editor integration at a time; this project folds an LSP mode for ten languages into the same binary rather than asking you to run several.

The repository has drawn a large audience quickly — over 44,000 stars and 3,600 forks since it was created in February 2026, with commits still landing in September — so it is neither obscure nor abandoned. Take it seriously if you pay real money for agent tokens, or if you have simply watched an agent spend a minute rediscovering a call chain you already knew. The performance figures are the project's own and worth confirming on your own repository, but the underlying idea — parse once, query many times, hand the agent a map rather than a flashlight — is sound, and the pure-C single-binary packaging makes trying it cheap.

More in Developer tools

All of Developer tools →