Better Code Review Graph logo

Better Code Review Graph

Builds a code knowledge graph for semantic search, call-graph analysis, security scans, and focused review context over MCP.

Install Better Code Review Graph

Run the project’s own setup commands, in order.

Setup steps from the project

better-code-review-graph installs with its own commands rather than a config we can generate, so these are copied as-is. Run them in order in a terminal. Source: github.com

  1. 1. Install
    pip install n24q02m-crg
    
  2. 2. Add to Claude Code
    claude mcp add crg -- uvx --python 3.13 n24q02m-crg
    
  3. 3. Start the server
    uvx --python 3.13 n24q02m-crg
    
  4. 4. Start the server
    uv run n24q02m-crg server start
    
  5. 5. Configure
    cp docker-config/config.example.toml docker-config/config.toml
    

Overview

better-code-review-graph parses a repository with Tree-sitter and stores functions, classes, imports, relationships, and temporal graph data for code analysis. Its MCP tools build or update the graph, search symbols and relationships, trace impact, and generate review context from Git changes. Semantic search uses a local ONNX model registry by default, with an optional cloud embedding chain. Reach for it when an agent needs focused structural context instead of loading an entire codebase.

Use cases

  • Build a searchable graph from a repository
  • Trace the impact of changed files
  • Generate focused context for code reviews
  • Compare structural changes between commits
  • Scan the graph for security findings

Key features

  • Tree-sitter code graph construction
  • Semantic search with local ONNX embeddings
  • Call-graph and relationship analysis
  • Git-aware review context generation
  • Heuristic and Semgrep security scanning
  • Graph export, import, and temporal change tracking

Tools6

What Better Code Review Graph lets your agent do. Expand a tool for its parameters.

Verified live~1.7k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

13/13 checks healthy over the last 56d

What it can do

From the 6 tools this server returned when we ran it; 6 declare their own safety hints.

Can delete or modify data · 2Handles credentials · 1Makes network requests · 1Read-only tools · 4
Network at startup2 connections
Files written at startup1

Observed 2026-10-29 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 11d ago via OSV.dev

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars76Stargazers on the source repository.
Last commit1d agoMost recent push to the default branch.
Tools exposed6Callable tools this server registers over MCP.

How Better Code Review Graph works

What better-code-review-graph does

better-code-review-graph turns a repository into a queryable code knowledge graph. Parsing is performed with Tree-sitter, with graph data centered on functions, classes, imports, call relationships, and other structural connections. The server exposes this graph through MCP and can also be used through its crg command-line interface.

The review workflow is designed to reduce the amount of source an agent must inspect. Review context can identify changed files from Git, summarize affected structure, find impacted nodes, include selected source snippets, and return review guidance. The graph also supports semantic search, relationship queries, call-site inspection, inheritance and import analysis, and comparisons between commits.

How it works

Build the graph with the graph tool, either from scratch or incrementally. Other graph actions report statistics, create embeddings, export or import graph data, and produce summaries. The query tool then searches the graph or examines relationships and change impact. It can also identify large functions, sample call-site snippets, detect symbols whose callsite lines moved, and compare nodes added, removed, or modified between two commit SHAs.

The review tool provides two review-oriented paths. context derives a focused review package from a Git diff, while delta compares two commits and can optionally report qualified names whose starting lines changed. Graph nodes and edges include temporal columns for tracking validity across revisions.

Semantic search uses the local ONNX model registry from fastretrieval by default, so the local path requires no API key. An optional cloud embedding chain is available when a different embedding setup is appropriate.

Setup and configuration

The package is distributed on PyPI as n24q02m-crg, and the primary command is crg. It supports Python 3.13. A one-off graph operation can run through uvx, for example:

bash
uvx --python 3.13 --from n24q02m-crg crg graph build --full-rebuild \
  --repo-root /path/to/repo

Install the package with pip install n24q02m-crg when persistent console scripts are preferred. The optional Semgrep security engine is installed with the security extra.

MCP can run over stdio or self-hosted HTTP. For stdio clients, register the package command with uvx --python 3.13 n24q02m-crg and set MCP_TRANSPORT=stdio. Self-hosted HTTP exposes an MCP endpoint at /mcp; the documented local development mode uses loopback, while always-on deployment uses token authentication. Configuration is stored under CRG_CONFIG_DIR or ~/.crg.

The config tool reports server state, changes the log level, clears embedding caches, and manages model-cell setup. Setup can use host-provided model configuration or be switched to local mode.

Tools and capabilities

  • graph: Build, update, inspect, embed, summarize, export, and import the knowledge graph.
  • query: Search code and resolve relationships, impact, callers, callees, inheritors, importers, line shifts, and commit deltas.
  • review: Generate focused context for changed files or compare two commits for review.
  • security: Run heuristic or Semgrep scans, list rules, suppress findings, and emit JSON or SARIF reports.
  • config: Inspect configuration, manage logging and embedding caches, and control model setup.
  • help: Retrieve detailed documentation for tools, security behavior, and usage recipes.

Limitations and notes

The project is CLI-first; its MCP adapter is a secondary interface. HTTP operation is self-hosted rather than provided through a hosted endpoint. The Semgrep scanner requires the optional security installation. Opening a graph created before the schema change automatically applies the migration and saves a pre-migration database backup, so deployments should account for that database transition.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Better Code Review Graph

better-code-review-graph is an MCP server that connects AI coding clients to a Tree-sitter code knowledge graph. Its main tools build and query graph data, generate focused review context from Git changes, manage embeddings, and run heuristic or Semgrep security scans over a repository.

Install it with `pip install n24q02m-crg` or run it without a persistent install through `uvx --python 3.13 --from n24q02m-crg crg`. For MCP stdio, register `uvx --python 3.13 n24q02m-crg` with the client and set `MCP_TRANSPORT=stdio`.

Yes, better-code-review-graph works with Cursor through its MCP settings. Add the stdio `mcpServers` configuration using `uvx --python 3.13 n24q02m-crg`, or point Cursor at a self-hosted `/mcp` endpoint.

It uses the `review` tool's `context` action to detect changed files from a Git diff and return structural summaries, impacted nodes, source snippets, and review guidance. The `delta` action compares two commit SHAs and can report qualified names whose starting lines moved.

Yes, its `security` tool supports heuristic scans and an optional Semgrep engine. It can list rules, suppress findings, and produce JSON or SARIF reports. Install the Semgrep support with the package's `security` extra.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewBetter Code Review Graph AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/better-code-review-graph?style=directory)](https://allmcps.com/mcp/better-code-review-graph)
HTML Embed
<a href="https://allmcps.com/mcp/better-code-review-graph"><img src="https://allmcps.com/api/badge/better-code-review-graph?style=directory" alt="Better Code Review Graph on AllMCPs" /></a>