Knowledge graph for token-efficient code reviews
better-code-review-graph
mcp-name: io.github.n24q02m/better-code-review-graph
Knowledge graph for token-efficient code reviews -- fixed search, configurable embeddings, qualified call resolution.
Fork of code-review-graph with critical bug fixes, configurable embeddings, and production CI/CD. Parses your codebase with Tree-sitter, builds a structural graph of functions/classes/imports, and gives Claude (or any MCP client) precise context so it reads only what matters.
Features
| Feature | code-review-graph | better-code-review-graph |
|---|---|---|
| Multi-word search | Broken (literal substring) | AND-logic word splitting |
| callers_of/callees_of | Empty results (bare name targets) | Qualified name resolution + bare fallback |
| Embedding | sentence-transformers + torch (1.1 GB) | qwen3-embed ONNX + LiteLLM (200 MB), dual-mode |
| Output size | Unbounded (500K+ chars) | Paginated (max_results, truncated flag) |
| Tool design | 9 individual tools | 5 tools: graph + query + review + config + help |
| Plugin hooks | Invalid PostEdit/PostGit | Valid PostToolUse |
All fixes are submitted upstream as standalone PRs (see Upstream PRs). If all are merged, this repo will be archived.
Quick Start
Claude Code Plugin (Recommended)
claude plugin add n24q02m/better-code-review-graph
Includes MCP server, hooks (SessionStart auto-build, PostToolUse auto-update), and skills (build-graph, review-delta, review-pr).
MCP Server
Option 1: uvx
claude mcp add better-code-review-graph -- uvx --python 3.13 better-code-review-graph
Other MCP clients (Cursor, Codex, Gemini CLI, Windsurf, Cline, Amp, OpenCode)
// Cursor (~/.cursor/mcp.json)
// Windsurf (~/.codeium/windsurf/mcp_config.json)
// Cline (cline_mcp_settings.json)
// Amp (~/.config/amp/settings.json)
// OpenCode (~/.opencode.json)
{
"mcpServers": {
"better-code-review-graph": {
"command": "uvx",
"args": ["--python", "3.13", "better-code-review-graph"]
}
}
}
# Codex (~/.codex/config.toml)
[mcp_servers.better-code-review-graph]
command = "uvx"
args = ["--python", "3.13", "better-code-review-graph"]
// Gemini CLI (~/.gemini/settings.json)
{
"mcpServers": {
"better-code-review-graph": {
"command": "uvx",
"args": ["--python", "3.13", "better-code-review-graph"]
}
}
}
Option 2: Docker
docker run -i --rm n24q02m/better-code-review-graph
Option 3: pip
pip install better-code-review-graph
better-code-review-graph
Claude Code Plugin Details
When installed as a plugin, you get:
Hooks:
- SessionStart: Auto-builds the code graph when a conversation starts
- PostToolUse: Auto-updates the graph after file modifications (Write, Edit, MultiEdit, Bash)
Skills:
- build-graph: Build or rebuild the knowledge graph for the current project
- review-delta: Review uncommitted changes using graph context
- review-pr: Review a pull request with structural analysis
Tools
`graph` -- Graph lifecycle
Actions: build | update | stats | embed
| Action | Description |
|---|---|
build |
Full or incremental graph build. Set `full_rebuild=t |
Tools (1)
graphManages the knowledge graph lifecycle including building, updating, and embedding.Configuration
{"mcpServers": {"better-code-review-graph": {"command": "uvx", "args": ["--python", "3.13", "better-code-review-graph"]}}}