MCP Server Indexes Codebases into Knowledge Graph for 10x Token Reduction

✍️ OpenClawRadar📅 Published: March 7, 2026🔗 Source
MCP Server Indexes Codebases into Knowledge Graph for 10x Token Reduction
Ad

codebase-memory-mcp is an MCP server that replaces file-by-file code exploration with graph queries for AI coding assistants. It parses codebases with tree-sitter into a persistent knowledge graph stored in SQLite, containing functions, classes, call relationships, HTTP routes, and cross-service links as nodes and edges.

Key Features and Specifications

  • Single Go binary with zero infrastructure requirements (no Docker, no databases, no API keys)
  • Supports 35 programming languages
  • Sub-millisecond query performance
  • Auto-syncs on file changes via background polling
  • Cypher-like query language for complex graph patterns
  • MIT licensed
Ad

Performance Benchmarks

The server was benchmarked across 35 real-world repositories, showing at least 10x fewer tokens for structural questions compared to traditional file-by-file exploration. Example: A query like "what calls ProcessOrder?" returns a precise call chain in one graph query (~500 tokens) instead of reading dozens of files (~80K tokens).

Tested repositories ranged from 78 to 49,000 nodes. The Linux kernel stress test handled 20,000 nodes and 67,000 edges with zero timeouts.

Use Case for Local LLM Setups

This is particularly valuable for local LLM setups with smaller context windows (8K-32K), where every token counts. The graph returns exactly the structural information needed without dumping entire file contents into context.

The server works with any MCP-compatible client or via CLI mode for direct terminal use.

📖 Read the full source: r/LocalLLaMA

Ad

👀 See Also