better-code-review-graph
Knowledge graph for token-efficient code reviews with Tree-sitter parsing, dual-mode embedding (ONNX + LiteLLM), and blast-radius analysis via MCP tools.
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 + cloud (200 MB), dual-mode |
| Output size | Unbounded (500K+ chars) | Paginated (max_results, truncated flag) |
| Tool design | 9 individual tools | 6 tools: graph + query + review + config + setup + help |
| Plugin hooks | Invalid PostEdit/PostGit | Valid PostToolUse |
Status
2026-05-02 -- Architecture stabilization update
Past months saw significant churn around credential handling and the daemon-bridge auto-spawn pattern. This caused multi-process races, browser tab spam, and inconsistent setup UX across plugins. As of v, the architecture is stable: 2 clean modes (stdio + HTTP), no daemon-bridge layer, no auto-spawn from stdio.
Apologies for the instability period. If you encountered issues with prior versions, please update to v+ and follow the current
docs/setup-manual.md-- most prior workarounds are no longer needed.Related plugins from the same author:
- wet-mcp -- Web search + content extraction
- mnemo-mcp -- Persistent AI memory
- imagine-mcp -- Image/video understanding + generation
- better-notion-mcp -- Notion API
- better-email-mcp -- Email management
- better-telegram-mcp -- Telegram
- better-godot-mcp -- Godot Engine
All plugins share the same architecture -- install once, learn pattern transfers.
Setup
- Stdio mode (default) -- local SQLite graph store, optional API keys (
JINA_AI_API_KEY,GEMINI_API_KEY,OPENAI_API_KEY,COHERE_API_KEY). See setup-manual.md. - HTTP mode (optional) -- multi-user, browser-based API key setup via paste-token relay form. See setup-manual.md.
With AI Agent -- copy and send this to your AI agent:
Please set up better-code-review-graph for me. Follow this guide: https://raw.githubusercontent.com/n24q02m/better-code-review-graph/main/docs/setup-with-agent.md
Manual Setup -- follow docs/setup-manual.md
Tools
graph -- Graph lifecycle
Actions: build | update | stats | embed
| Action | Description |
|---|---|
build | Full or incremental graph build. Set full_rebuild=true to re-parse all files. |
update | Alias for build with full_rebuild=false (incremental). |
stats | Graph size, languages, node/edge breakdown, embedding count. |
embed | Compute vector embeddings for semantic search. Dual-mode: local ONNX or cloud. |
query -- Graph queries
Actions: query | search | impact | large_functions
| Action | Description |
|---|---|
query | Predefined pattern queries: callers_of, callees_of, imports_of, importers_of, children_of, tests_for, inheritors_of, file_summary. |
search | Search code entities by name/keyword or semantic similarity. |
impact | Blast radius of changed files. Auto-detects from git diff. Paginated with max_results. |
large_functions | Find functions/classes exceeding a line-count threshold. |
review -- Code review context
Token-optimized review context with structural summary, source snippets, and review guidance. Auto-detects changed files from git diff.
config -- Server configuration
Actions: status | set | cache_clear
| Action | Description |
|---|---|
status | Server info: version, graph path, node/edge counts, embedding backend. |
set | Update runtime settings (e.g., log_level). |
cache_clear | Remove all computed embeddings. |
setup -- Credential setup
Actions: status | start | skip | reset | complete
| Action | Description |
|---|---|
status | Show current credential state and setup URL. |
start | Start relay setup to configure API keys via browser. |
skip | Set local mode (skip relay permanently, use ONNX only). |
reset | Clear credentials and reset state. |
complete | Re-resolve credentials from environment variables. |
help -- Full documentation
Topics: graph | query | review | config
Returns complete documentation for each tool. Use when the compressed descriptions above are insufficient.
Security
- Graceful fallbacks -- Cloud embedding failure falls back to local ONNX
- Error handling -- Tools return error strings with fix suggestions, never crash
- Read-only mount -- Docker mode mounts repo as
:ro(read-only)
Build from Source
git clone https://github.com/n24q02m/better-code-review-graph
cd better-code-review-graph
uv sync --group dev
uv run pytest
uv run better-code-review-graph
Requirements: Python 3.13, uv
Trust Model
This plugin implements TC-Local (machine-bound, single trust principal). See mcp-core/docs/TRUST-MODEL.md for full classification.
| Mode | Storage | Encryption | Who can read your data? |
|---|---|---|---|
| stdio (default) | ~/.better-code-review-graph-mcp/config.json | AES-GCM, machine-bound key | Only your OS user (file perm 0600) |
| HTTP self-host | Same as stdio | Same | Only you (admin = user) |
License
MIT -- See LICENSE.
Máy chủ liên quan
Alpha Vantage MCP Server
nhà tài trợAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
ShaderToy-MCP
Query and interact with ShaderToy shaders using large language models.
Zen MCP
An AI-powered server providing access to multiple models for code analysis, problem-solving, and collaborative development with guided workflows.
InsForge MCP Server
InsForge is a backend development platform designed for agentic coding.
USolver
A server for solving combinatorial, convex, integer, and non-linear optimization problems.
TeamCity
MCP server for TeamCity, integrates with Claude Desktop and Cursor.
Homebrew MCP
Interact with Homebrew (the package manager for macOS and Linux) using natural language commands.
Test MCP Server
A sample MCP server implemented in Node.js for development and testing purposes.
EndOfLife.date
Get end-of-life dates and support cycle information for various software products.
Build-Scout
Interact with various build systems including Gradle, Maven, NPM/Yarn, Cargo, Python, Makefile, and CMake.
mistral-mcp
MCP server exposing the full Mistral AI surface (chat, OCR, Codestral FIM, Voxtral audio, vision, agents, moderation, classification, files, batch). Stdio + Streamable HTTP, BYOK with Mistral's free 1B tokens/month