A code search engine that fits in a single binary and eats the Linux kernel for breakfast
An MCP server that turns your entire codebase into a queryable knowledge graph, running locally with zero dependencies to cut AI agent token usage by 99%.
codebase-memory-mcp builds a persistent knowledge graph inside a single static binary, letting AI coding agents query structure instead of reading files.

What it does
codebase-memory-mcp is an MCP server that ingests your codebase and exposes it as a structured knowledge graph to AI coding agents. It parses 157+ languages via vendored tree-sitter grammars, resolves types through a clean-room “Hybrid LSP” implementation for six major languages, and answers structural queries in under a millisecond. Everything persists locally in SQLite; your code never leaves the machine.
The interesting bit
The project is written in pure C as a single static binary with zero runtime dependencies — no Docker, no API keys, no Ollama. It bundles its own vector embeddings (nomic-embed-code, 768d int8, 40K tokens) and runs a RAM-first indexing pipeline with LZ4 compression and in-memory SQLite, dumping to disk only at completion. The Linux kernel (28M LOC, 75K files) indexes in three minutes. The authors back this with an arXiv preprint and claim 83% answer quality across 31 real-world repos with 10× fewer tokens than file-by-file exploration.
Key highlights
- 14 MCP tools including Cypher-like graph queries, dead-code detection, architecture overviews, and cross-service HTTP route linking
- Semantic search with 11-signal scoring (TF-IDF, AST profiles, data flow, MinHash, graph diffusion)
- Auto-detects and configures 11 coding agents (Claude Code, Codex, Cursor-adjacent tools, etc.) via a single
installcommand - Optional 3D graph visualization UI served at
localhost:9749 - Infrastructure-as-code indexing: Kubernetes manifests, Dockerfiles, and Kustomize overlays become first-class graph nodes
- Background file watcher for incremental re-indexing on git changes
Caveats
- The “120× fewer tokens” and “99% fewer tokens” claims appear to use different baselines; the arXiv preprint cites 10× fewer tokens, so treat the larger figure as a best-case marketing rounding
- Hybrid LSP covers six languages well but leaves many others at AST-only depth
- The project is young enough that long-term stability of the 157 vendored grammars and the custom LSP reimplementations remains to be battle-tested
Verdict
Worth a look if you’re burning context-window tokens on large codebases or want offline, dependency-free code intelligence. Probably overkill if you live in a single-language monorepo already well-served by existing LSPs.
Frequently asked
- What is DeusData/codebase-memory-mcp?
- An MCP server that turns your entire codebase into a queryable knowledge graph, running locally with zero dependencies to cut AI agent token usage by 99%.
- Is codebase-memory-mcp open source?
- Yes — DeusData/codebase-memory-mcp is open source, released under the MIT license.
- What language is codebase-memory-mcp written in?
- DeusData/codebase-memory-mcp is primarily written in C.
- How popular is codebase-memory-mcp?
- DeusData/codebase-memory-mcp has 34.2k stars on GitHub and is currently cooling off.
- Where can I find codebase-memory-mcp?
- DeusData/codebase-memory-mcp is on GitHub at https://github.com/DeusData/codebase-memory-mcp.