What it does
code-graph-mcp indexes your codebase into a structured Abstract Syntax Tree (AST) knowledge graph, enabling semantic search, call graph traversal, and HTTP route mapping. It parses multiple languages—TypeScript, JavaScript, Go, Python, Rust, and Java get full support (calls, imports, inheritance, HTTP routes, test markers); others like C#, Kotlin, Ruby, PHP, Swift, and Dart receive partial support. The tool detects dead code, performs impact analysis to measure blast radius of code changes, and compresses code snippets to fit LLM context windows efficiently. It uses BLAKE3 Merkle trees for incremental indexing to skip unchanged files, and runs entirely offline with no external dependencies—SQLite and optional local embeddings stay on your machine. MCP integration lets you use it directly in Claude Code, Cursor, Windsurf, and other compatible clients.
Who it's for
Backend engineers and AI-assisted developers working with large codebases in Claude Code, Cursor, or Windsurf. Teams performing code reviews, impact analysis, or refactoring. Developers who prefer offline tooling and don't want external database servers or cloud APIs.
Common use cases
- Search for code by semantic meaning (e.g., "handle user login") to find the right function even if naming differs.
- Trace caller and callee chains recursively across files with cycle detection.
- Analyze the blast radius of a code change by determining all affected downstream code.
- Map HTTP route paths to backend handler functions in Express, Flask/FastAPI, or Go.
- Identify unreferenced symbols and dead code in large projects.
Setup pitfalls
- Requires full filesystem read and write access to index and maintain the SQLite knowledge graph database.
- Some languages are limited to file-based full-text search: HTML, CSS, JSON have no AST symbol extraction.
- C and C++ support defers
Class::methodscope qualification; call targets may be ambiguous across the codebase. - Local embedding model is optional and feature-gated behind the
embed-modelflag; semantic search works without it but uses BM25 full-text only.