When an AI coding agent needs to understand a large repo, it usually reads files one by one — burning tokens and context. codebase-memory-mcp, an open-source MCP server trending hard on GitHub, takes a different route: it indexes the whole codebase into a persistent knowledge graph of functions, classes, call chains, and HTTP routes, then answers structural questions in under a millisecond.
## What codebase-memory-mcp does
It is a structural backend, not a chatbot — no embedded LLM, no API key. Your MCP client (Claude Code or any compatible agent) stays the intelligence layer while the server builds and serves the graph locally, so code never leaves your machine. It covers 158 languages via tree-sitter, with deeper LSP type resolution for Python, TypeScript, Go, Rust, Java, and more. It full-indexes an average repo in milliseconds and the 28M-line Linux kernel in about three minutes.
## The token math
The headline pitch is efficiency. In one test, five structural queries cost roughly 3,400 tokens through codebase-memory-mcp versus about 412,000 tokens doing file-by-file grep exploration — a 99.2% reduction. It ships as a single zero-dependency binary with 14 MCP tools across 11 agents.

Leave a comment