codebase-memory-mcp

Stop paying 100x more tokens for code exploration. A knowledge graph MCP server that gives AI coding assistants precise structural answers in a single query.

120x
fewer tokens
59
languages
<1ms
query time
0
dependencies

Install in 3 steps

# 1. Download for your platform
tar xzf codebase-memory-mcp-*.tar.gz
mv codebase-memory-mcp ~/.local/bin/

# 2. Auto-configure your editor
codebase-memory-mcp install

# 3. Restart your editor, then say:
"Index this project"

Works with Claude Code, Codex CLI, Cursor, Windsurf, Gemini CLI, VS Code, and Zed. Also has a CLI mode for direct terminal use.

The problem

AI coding assistants explore codebases by reading files one at a time. Every structural question triggers a cascade of grep → read file → grep again → read more files.

Five structural questions about a real codebase: ~412,000 tokens via file-by-file search. ~3,400 tokens via knowledge graph queries.

The 120x reduction isn't about fitting in the context window. It's about cost ($3-15/M tokens adds up), latency (<1ms vs seconds), and accuracy (less noise = better answers, no "lost in the middle" problem).

Benchmark results

Question Type Graph File-by-file Savings
Find function by pattern ~200 ~45,000 225x
Trace call chain (depth 3) ~800 ~120,000 150x
Dead code detection ~500 ~85,000 170x
List all routes ~400 ~62,000 155x
Architecture overview ~1,500 ~100,000 67x
Total ~3,400 ~412,000 121x

Tested across 31 languages with agent-vs-agent methodology (372 questions). MCP achieves 90% of Explorer quality at 20-100x lower per-query cost. Full benchmark report →

Features

59 Languages

Python, Go, JS, TS, TSX, Rust, Java, C++, C#, C, PHP, Ruby, Kotlin, Scala, Zig, Elixir, Haskell, OCaml, Swift, Dart, and 39 more via vendored tree-sitter grammars.

Call Graph Tracing

Trace callers and callees across files and packages. Import-aware, type-inferred resolution. BFS traversal up to depth 5.

Dead Code Detection

Find functions with zero callers, with smart filtering that excludes entry points (route handlers, main(), framework decorators).

Cross-Service HTTP Linking

Discovers REST routes and matches them to HTTP call sites across services with confidence scoring.

Auto-Sync

Background polling detects file changes and triggers incremental re-indexing. No manual reindex needed.

Cypher Queries

Ad-hoc graph exploration with a Cypher-like query language: MATCH, WHERE, RETURN, ORDER BY, LIMIT.

Architecture Overview

Languages, packages, entry points, routes, hotspots, boundaries, and hidden modules via Louvain community detection.

Git Diff Impact

Map uncommitted changes to affected symbols + blast radius with CRITICAL/HIGH/MEDIUM/LOW risk classification.

12 MCP Tools

search_graph, trace_call_path, detect_changes, query_graph, get_architecture, manage_adr, and 6 more.

How it compares

Feature codebase-memory-mcp GitNexus
Languages598-11
RuntimeSingle Go binaryNode.js (npx)
Runtime dependencyNoneNode.js
Embedded LLMNo (uses your MCP client)Yes (extra API key + cost)
Published benchmarksYes (31 langs, 372 questions)No
Auto-syncYesNo
MCP tools127
Cross-service HTTP linkingYesNo
Cypher queriesYesNo
Visual web UINoYes
Graph RAG chatNoYes

GitNexus is a visual dashboard — great for interactive exploration. codebase-memory-mcp is production tooling — the most comprehensive, zero-dependency backend for AI coding assistants.