Codebase-Memory MCP Server for Knowledge Graph Analysis
A new Model Context Protocol (MCP) server that indexes repositories into knowledge graphs using tree-sitter. It provides sub-millisecond structural queries and 120x token savings compared to file-by-file exploration.
Impact: High
Why it matters
Replace inefficient grep/read cycles with semantic, graph-based queries to improve agentic accuracy and reduce API costs.
TL;DR
- 01Index huge repositories in minutes locally.
- 02Reduces token usage by 120x compared to standard grep.
- 03Works with 11 different AI coding agents.
Architecture and Performance
The tool leverages a RAM-first pipeline using LZ4 compression and fused Aho-Corasick pattern matching to index codebases. It is explicitly designed to handle structural queries efficiently, replacing hundreds of token-heavy file reads with targeted graph lookups.
Deployment
Installation is handled via a single binary for macOS, Linux, or Windows. It auto-detects installed coding agents and configures the necessary MCP server entries and pre-tool hooks automatically.
Capabilities
- 158 Languages: Built-in tree-sitter grammars.
- Graph Visualization: Built-in 3D UI available via
--uiflag. - Hybrid Search: Combines BM25 full-text search with vector embeddings.
Try it in 2 minutes
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bashbash
✓ When to use
- Large repositories exceeding context windows
- When performing complex refactoring across services
- When you want to reduce token costs for coding agents
What to do today
- Run the install script: curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
- Enable auto-indexing: codebase-memory-mcp config set auto_index true
Sources