🔌

Code Review Graph

Code Intelligence•⭐ 24,150

Local-first code intelligence graph with 30 MCP tools and 82x token reduction for AI coding assistants.

Claude DesktopCursorClaude CodeWindsurf

Overview

Local-first code intelligence graph with 30 MCP tools and 82x token reduction for AI coding assistants.

Setup

Run with npx:

pip install code-review-graph && code-review-graph install && code-review-graph build

Configuration

Build graph in repo root with `code-review-graph build`; MCP server starts with `code-review-graph serve`

Documentation

Code Review Graph

Overview

Code Review Graph (tirth8205/code-review-graph) is a local-first code intelligence graph designed for MCP and CLI use. It builds a persistent map of your codebase so AI coding tools read only what matters — typically reducing token usage by 82x (median, range 38x–528x across 6 benchmark repositories).

The tool parses your repository into an Abstract Syntax Tree (AST) using Tree-sitter, then stores the result as a graph of nodes (functions, classes, imports, tests) and edges (call relationships, inheritance, test coverage). When an AI assistant needs context, the graph queries the minimal set of files it actually needs to read, rather than scanning the entire repository.

With 24,000+ GitHub stars and 3,000+ weekly gains, Code Review Graph is one of the fastest-growing code intelligence tools in the MCP ecosystem. It exposes 30 MCP tools for blast-radius analysis, review context, graph traversal, and semantic search — and can be used standalone via CLI or integrated with any MCP-compatible AI assistant.

Features

  • Persistent Code Graph: AST-based graph built once, updated incrementally in under 2 seconds per changed file
  • Blast-Radius Analysis: Trace every caller, dependent, and test affected by a code change
  • Minimal Context Retrieval: Cuts AI tool context tokens by 38x–528x
  • 30 MCP Tools: Including get_impact_radius_tool, get_review_context_tool, detect_changes_tool, semantic_search_nodes_tool, and refactoring tools
  • Broad Language Support: Python, JavaScript/TypeScript, Go, Rust, Java, C/C++, and more via Tree-sitter; plus Jupyter notebook support
  • Watch Mode: Automatic graph maintenance as files change
  • Multi-Repo Daemon: Manage graphs across multiple repositories from a single process
  • Custom Language Support: Add new languages via languages.toml config — no fork needed
  • Export Options: GraphML, Neo4j Cypher, Obsidian vault, SVG, and JSON
  • GitHub Action: Risk-scored PR reviews integrated into CI/CD

Installation

# Install via pip
pip install code-review-graph

# Auto-detect and configure your platform
code-review-graph install

# Build the graph for your current codebase
code-review-graph build

Quick Start

# Navigate to your project root
cd /path/to/your/project

# Build the initial graph
code-review-graph build

# Verify the graph
code-review-graph eval

# Start watch mode for incremental updates
code-review-graph watch

MCP Configuration

Once the graph is built, AI assistants with MCP support will automatically use the 30 available tools. Configure it in your Claude Desktop or other MCP client:

{
  "mcpServers": {
    "code-review-graph": {
      "command": "code-review-graph",
      "args": ["serve"]
    }
  }
}

Available MCP Tools

ToolDescription
get_impact_radius_toolFind all code affected by a change
get_review_context_toolGet minimal review context for a PR
detect_changes_toolDetect what files changed and why
semantic_search_nodes_toolSearch the code graph semantically
graph_traversalNavigate call graphs and dependencies
refactoring_toolsGet refactoring suggestions with impact analysis

CLI Commands

code-review-graph build      # Parse your codebase into a graph
code-review-graph update     # Incremental update after file changes
code-review-graph watch      # Continuous watch mode
code-review-graph visualize  # Generate SVG visualization of the graph
code-review-graph wiki       # Generate a project wiki from the graph
code-review-graph eval       # Evaluate graph quality
code-review-graph serve      # Start MCP server

Export Formats

  • GraphML: For Graphviz, Gephi, or other graph visualization tools
  • Neo4j Cypher: Direct import into Neo4j graph databases
  • Obsidian Vault: Link graphs that integrate with Obsidian knowledge bases
  • SVG: Static visualizations for documentation or presentations
  • JSON: Programmatic access for custom tooling

Advanced: Custom Language Support

Add a new language by editing languages.toml:

[[languages]]
name = "my-lang"
tree-sitter = "tree-sitter-my-lang"
file_extensions = [".mlang"]

No fork required — the tool picks up the config on next build.

Use Cases

  • Code Reviews: Before reviewing a PR, query the graph for the minimal context and full blast radius — review in seconds instead of minutes
  • Onboarding: Use visualize to generate architecture diagrams for new team members
  • Refactoring: Get impact analysis before making breaking changes
  • Test Coverage: See which tests exercise which code paths
  • MCP Integration: Let any MCP-compatible AI assistant get code intelligence automatically

Pros

  • ✅ Dramatic token reduction (38x–528x) for AI-assisted code reviews
  • ✅ Broad language support via Tree-sitter
  • ✅ Fast incremental updates (< 2 seconds)
  • ✅ MCP-native with 30 built-in tools
  • ✅ Custom language support without forking
  • ✅ Multiple export formats for ecosystem integration
  • ✅ GitHub Action for CI/CD integration

Cons

  • ❌ Requires graph build step before use — initial parse can take time on large repos
  • ❌ Python-only CLI — not as native for Node.js-heavy workflows
  • ❌ MCP integration requires an MCP-compatible AI assistant
  • ❌ Jupyter notebook support may be limited on complex interactive notebooks

When to Use

Use Code Review Graph if you want to reduce AI assistant context costs, accelerate code reviews, or add structured code intelligence to your MCP tooling. It is especially valuable for:

  • Large codebases where scanning the entire repo for AI context is expensive
  • PR review workflows where blast-radius analysis is critical
  • Multi-language monorepos that need consistent code intelligence across languages
  • MCP-heavy agent setups where code intelligence is a core capability

Resources