skillfed

code-review-graph

Local-first knowledge graph for token-efficient code review through MCP and CLI

code-review-graph v2.3.7 418.0K downloads/30d#6,805 on PyPI30,124
Permissive license MIT Active released

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 on this page — 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

code-review-graph on PyPI

pip

pip install code-review-graph

uv

uv add code-review-graph

poetry

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 the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 8 — fastmcp, mcp, networkx, pyyaml, tomli, tree-sitter-language-pack, tree-sitter, watchdog
Maintenance actively maintained — 27 days since the last release
Last repo commit
First released
Downloads 417,955/month — #6,805 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: code_review_graph-2.3.7-py3-none-any.whl

Keywords: ai-coding-tools, code-review, knowledge-graph, mcp, tree-sitter

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development :: Quality Assurance

Tags

code review graph ai assistanttree-sitter knowledge graphmcp code contexttoken-efficient code reviewblast radius analysisincremental codebase indexingai coding tool integration
mcp-integrationai-coding-toolsgraph-analysis

More Quality Assurance packages

Further reading