How It Works
Automatic Indexing
On first connection, Codebase Memory scans your project and builds a knowledge graph of:
- File structure and dependencies
- Function/class definitions and relationships
- Import chains and module boundaries
- Code patterns and conventions
Smart Context Retrieval
Instead of dumping entire files into the LLM context, Codebase Memory returns precisely the relevant code snippets:
User: "How does the payment processing work?"
Agent: [queries knowledge graph] → returns only payment-related functions,
their dependencies, and data flow — not entire files66 Language Support
Built on Tree-sitter parsers for accurate AST analysis across languages: TypeScript, Python, Go, Rust, Java, C++, Ruby, PHP, Swift, Kotlin, and 56 more.
Persistent Graph
The knowledge graph persists between sessions. Re-indexing only processes changed files:
First index: ~30 seconds for a 100K LOC project
Subsequent: <1 second (incremental)Query Capabilities
"What functions call the createUser method?"
"Show the data flow from API request to database"
"Find all error handling patterns in the codebase"
"What are the dependencies of the auth module?"Key Stats
- 1,100+ GitHub stars
- 66 programming languages supported
- Sub-millisecond query response
- 99% token reduction vs raw file context
- Single static binary, zero dependencies
- ~210K total downloads
FAQ
Q: What is Codebase Memory MCP? A: It is an MCP server that indexes your codebase into a persistent knowledge graph, letting AI agents understand project architecture and retrieve precise code context without reading entire files.
Q: Is Codebase Memory MCP free? A: Yes, open-source under Apache 2.0 license. All indexing runs locally.
Q: How much faster is it than raw file context? A: It uses 99% fewer tokens by returning only relevant code snippets instead of entire files. Queries return in sub-millisecond time.