Codebase Memory MCP: Graph-based code exploration for Claude Code

✍️ OpenClawRadar📅 Published: March 9, 2026🔗 Source
Codebase Memory MCP: Graph-based code exploration for Claude Code
Ad

A developer has created an MCP server called codebase-memory-mcp that addresses a common issue with Claude Code: inefficient token usage when exploring codebase structure. Instead of having Claude grep through files one at a time for questions like "what calls this function?" or "find dead code," this tool builds a persistent knowledge graph of the codebase.

How it works

The server uses Tree-sitter to parse 64 languages (including Python, Go, JavaScript, TypeScript, Rust, Java, and C++) into a SQLite-backed graph that captures functions, classes, call chains, HTTP routes, and cross-service links. When Claude Code asks structural questions, it queries this graph instead of scanning files individually.

Performance improvements

In one comparison, 5 structural questions consumed approximately 412,000 tokens via traditional file-by-file exploration versus only about 3,400 tokens via graph queries—a 120x reduction. The developer reports average savings of around 20x fewer tokens in regular usage, plus significant time savings.

Ad

Key features

  • 64 language support via Tree-sitter parsing
  • Call graph tracing: "what calls ProcessOrder?" returns full chain in <100ms
  • Dead code detection with smart entry point filtering
  • Cross-service HTTP linking (finds REST calls between services)
  • Cypher-like query language for ad-hoc exploration
  • Architecture overview with Louvain community detection
  • Architecture Decision Records that persist across sessions
  • 14 MCP tools (also works with Codex CLI, Cursor, Windsurf and other integrations)
  • CLI mode for direct terminal use without an MCP client

Setup and usage

The tool is a single Go binary with no Docker, external databases, or API keys required. Installation is via codebase-memory-mcp install which auto-configures Claude Code. Users simply say "Index this project" to begin, and the graph auto-syncs when files are edited to stay current.

Benchmarks and licensing

The developer benchmarked across 35 real open-source repositories ranging from 78 to 49,000 nodes, including the Linux kernel. The project is open source under MIT license.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also