Builds a persistent, local structural codebase graph with Tree-sitter and exposes it through MCP tools to reduce token usage by AI coding assistants during review tasks. Graph building and querying run on a local machine or CI runner, and optional remote embeddings are available for semantic search.
Project overview
Provides a Tree-sitter-powered knowledge graph and blast-radius analysis that narrows AI context to affected files, documented as running locally without sending source code to external services.
Project type
MCP · AI Agent · AI Coding
Use cases
Knowledge Q&A · Coding & Development
Deployment
Refer to project documentation
License
MIT
Best for
Developers using supported AI coding tools who need to reduce token consumption during code reviews of multi-file changes.
Teams running CI pipelines who want to post risk-scored pull request review comments derived from local AST analysis.
Key capabilities
Parses the codebase into an AST using Tree-sitter and stores the resulting graph of nodes and edges in SQLite.
Traces callers, dependents, and tests affected by a file change to compute the minimal set of files for review.
Exposes 30 MCP tools to provide AI assistants with precise code context and functions.
Provides optional vector embeddings via sentence-transformers, Google Gemini, MiniMax, or any OpenAI-compatible endpoint.
Runs as a composite GitHub Action to post sticky risk-scored pull request review comments.
Auto-detects supported AI coding tools and configures their MCP settings natively.
Supports Python, JavaScript/TypeScript, Go, Rust, Java, C/C++, and many others with Tree-sitter.
Re-parses only changed files using SHA-256 hash checks in under 2 seconds.
Limitations and risks
The impact 'recall 1.0' metric is graph-derived and circular, representing an upper bound rather than measured external ground truth.
For small single-file edits, the generated graph context can exceed the token usage of naive file reads.
Keyword search quality requires improvement, with a documented mean reciprocal rank (MRR) of 0.35.
Getting started
Run 'pip install code-review-graph' or use pipx. Then execute 'code-review-graph install' to auto-configure supported AI platforms and 'code-review-graph build' to construct the graph. Setup is rated as easy.
Alternatives and comparisons
Focuses on codebase intelligence by detecting patterns, conventions, and remembering decisions across sessions rather than AST-based blast radius analysis.
Exposes IDE-specific semantic language features for symbol manipulation rather than persistent structural mapping for review context reduction.
Evidence and sources
GitHub project description: Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on rev…
README: One command sets up everything. `install` detects which AI coding tools you have, writes the correct MCP configuration for each one, installs platform-native hooks/skills where su…
README: Your repository is parsed into an AST with Tree-sitter, stored as a graph of nodes (functions, classes, imports) and edges (calls, inheritance, test coverage), then queried at rev…