← Back to Discover

code-review-graph

A local tool that parses a codebase into a graph of functions, classes, imports and calls, then answers assistants' questions over MCP so they open only the files a change touches.

MCP serversCode reviewCommand-line tools

What it does

code-review-graph parses a repository with Tree-sitter into a graph whose nodes are functions, classes and imports and whose edges are calls, inheritance and test coverage. Everything is stored in a single SQLite file inside the project, with no external database or cloud service. If a file is edited, the graph follows its callers, dependents and tests, and an assistant that asks over MCP receives just that portion in place of the whole project. The graph stays current through editor hooks, a git pre-commit hook or a watch mode, each of which re-parses only files whose content hash changed. Other parts include risk-scored change detection, optional semantic search with embeddings from several providers, including local sentence-transformers models, an interactive graph view, and exports to formats such as GraphML, Neo4j Cypher and an Obsidian vault. A GitHub Action can post a risk-scored comment on each pull request, with an optional merge gate, and the README says the graph is built on your CI runner with no source code sent to an external service. Install with pip, then code-review-graph install detects the AI coding tools you have, such as Codex, Claude Code, Cursor, Windsurf, Zed, Continue and Gemini CLI, and writes an MCP entry for each. It needs Python 3.10 or later. The README reports a median per-question token reduction of about 63x across six repositories, and says plainly that small single-file edits can cost more context than a plain file read.

Capabilities

  • Structural graph of functions, classes, imports, calls and tests stored locally in SQLite
  • Blast-radius analysis showing which code and tests a change could affect
  • Incremental updates through hooks, a pre-commit hook or watch mode
  • One-command setup that configures many AI coding tools over MCP
  • GitHub Action with risk-scored pull request comments and an optional merge gate
  • Optional semantic search and graph exports

When to use it

  • Your AI assistant keeps re-reading large parts of a repository to review a change
  • You want to see what a change could break before merging
  • You want code context to stay on your own machine or CI runner