--- id: code-review-graph version: "2.3.7" license: MIT license_treatment: permissive maintenance: active --- # code-review-graph — Local-first knowledge graph for token-efficient code review through MCP and CLI License: permissive · Maintenance: active · Downloads: 418.0K/mo ## What it is and what it does code-review-graph parses your repository into a structural graph of functions, classes, imports, and their call relationships using Tree-sitter, then makes that graph queryable via MCP (Model Context Protocol) so AI coding assistants can pinpoint exactly which files matter for a code review instead of re-reading your entire codebase. It tracks changes incrementally—when a file is saved or committed, the graph updates in under 2 seconds by diffing only what changed and recomputing affected dependents. The tool integrates directly into AI coding platforms through a single `install` command that auto-detects your setup and writes the right MCP configuration. It also runs as a GitHub Action to post risk-scored PR reviews. For languages not yet built in, you can add custom parsers by dropping a TOML file into `.code-review-graph/` with grammar and node-type mappings—no fork or code changes needed. Use it for: - Reduce token spend in monorepo reviews: exclude thousands of unrelated files and focus context on the files actually affected by a change. - Integrate code review into CI/CD: run as a GitHub Action on pull requests to post automated, risk-scored reviews without sending source code externally. - Speed up incremental analysis: keep the graph updated via file-save hooks or watch mode so each review query runs against fresh, minimal context. - Support languages beyond the built-in set: add custom languages by writing a TOML config that maps file extensions to Tree-sitter grammars. - Trace blast radius for refactoring: see every caller, dependent, and test that could break when you change a function or class. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Builds a structural knowledge graph of your codebase using Tree-sitter and serves it via MCP to AI coding tools, so they read only the files affected by a change instead of scanning the whole project. Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real problem—AI code review tools waste tokens by re-reading large parts of your codebase. If you use supported AI coding platforms and want to cut review costs and latency, this is worth trying. The initial setup is one command, and the graph updates automatically. Start with a small project to verify the token savings match your use case. ## Install pip install code-review-graph uv add code-review-graph poetry add code-review-graph ## Installing code-review-graph Before you install: Low friction: pure Python wheel with eight runtime dependencies (networkx, tree-sitter, pyyaml, tomli, watchdog, fastmcp, mcp, tree-sitter-language-pack). Active maintenance—last commit 2026-08-02, 30124 stars, released 2.3.7 just 27 days ago. License in practice: MIT license (permissive): you can use, modify, and distribute freely with minimal restrictions. No copyleft obligations. Quickstart: pip install code-review-graph code-review-graph install code-review-graph build # Then ask your AI assistant: # "Build the code review graph for this project" Requires Python 3.10 or later. For best experience, install uv (optional but recommended for MCP config generation). Verify before relying: - Whether the 82x median token reduction benchmark holds across diverse codebases in production use. - Performance characteristics on projects larger than the 2,900-file test case mentioned. - Stability of custom language support via languages.toml across different Tree-sitter grammar versions. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 418.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags code review graph ai assistant, tree-sitter knowledge graph, mcp code context, token-efficient code review, blast radius analysis, incremental codebase indexing, ai coding tool integration, mcp-integration, ai-coding-tools, graph-analysis [View on SkillFed](https://skillfed.io/packages/code-review-graph) · [View on PyPI](https://pypi.org/project/code-review-graph/)