# code-review-graph — MCP Context for Smarter Reviews > code-review-graph builds a Tree-sitter code graph and exposes minimal review context via MCP; verified 16,364★ and claims ~8.2× token reduction on 6 repos. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use ```bash pip install code-review-graph # or: pipx install code-review-graph code-review-graph install --platform codex # or: cursor | claude-code | copilot code-review-graph build ``` ## Intro code-review-graph builds a Tree-sitter code graph and exposes minimal review context via MCP; verified 16,364★ and claims ~8.2× token reduction on 6 repos. **Best for:** Teams using coding agents who want smaller context windows and clearer blast-radius reviews **Works with:** Codex, Claude Code, Cursor, Windsurf, Zed, Copilot, and other MCP-capable tools **Setup time:** 5-12 minutes ### Key facts (verified) - GitHub: 16380 stars · 1781 forks · pushed 2026-05-08. - License: MIT · owner avatar + repo URL verified via GitHub API. - README-backed entrypoint: `code-review-graph`. ## Main - Run `install` once per machine to generate MCP config, then restart your tool so it can discover the server. - Use the graph as a review gate: ask for blast radius + minimal file set before edits, then iterate with smaller diffs. - Use README timings as sanity checks: ~10s initial build for ~500 files; incremental updates under ~2s for a 2,900-file repo (per docs). ### Source-backed notes - README says it parses repos with Tree-sitter, stores a graph, and serves context through MCP for agent review loops. - Quick Start shows `pip install` + `install` + `build` as the minimal loop. - README lists per-platform flags like `--platform codex` / `cursor` / `claude-code` / `copilot-cli`. ### FAQ - **Do I need MCP support in my tool?**: Yes—your editor/agent must be able to load MCP servers, or you’ll only use the CLI locally. - **Will it read my entire repo every time?**: The stated goal is the opposite: build once, then incrementally update and serve minimal context. - **What’s the fastest way to get started?**: Use pipx, run `install --platform `, restart the tool, then run `build`. ## Source & Thanks > Source: https://github.com/tirth8205/code-review-graph > License: MIT > GitHub: ⭐ 16380 · forks 1781 Thanks to the upstream maintainers for shipping the original project. --- ## 快速使用 ```bash pip install code-review-graph # or: pipx install code-review-graph code-review-graph install --platform codex # or: cursor | claude-code | copilot code-review-graph build ``` ## 简介 code-review-graph 用 Tree-sitter 构建代码结构图,并通过 MCP 提供最小审阅上下文;已验证 16,364★,并在文档中给出 6 个仓库平均约 8.2× 的 token 节省。 **适合谁用:** 使用 coding agent、想减少上下文与提升“影响面”审阅质量的团队 **适用环境:** Codex、Claude Code、Cursor、Windsurf、Zed、Copilot 等支持 MCP 的工具 **配置耗时:** 5-12 minutes ### 关键事实(已验证) - GitHub:16380 stars · 1781 forks;最近更新 2026-05-08。 - 许可证:MIT;作者头像与仓库链接均已通过 GitHub API 复核。 - README 中可对照的入口命令:`code-review-graph`。 ## 正文 - 每台机器先跑一次 `install` 生成 MCP 配置,然后重启编辑器/Agent CLI,让它能发现并连接 server。 - 把“结构图”当作审阅门禁:先让 agent 计算影响面与最小必读文件集,再开始修改,迭代更省 token。 - 用 README 的时间数据做自检:约 500 文件初次构建 ~10s;约 2,900 文件增量更新 <2s(文档口径)。 ### 基于来源的要点 - README 描述其用 Tree-sitter 解析仓库、构建结构图,并通过 MCP 服务为审阅/修改闭环提供最小上下文。 - Quick Start 给出最小闭环:`pip install` → `install` → `build`。 - README 列出多平台安装方式,并提供 `--platform codex/cursor/claude-code/copilot-cli` 等参数。 ### 常见问题 - **必须要工具支持 MCP 吗?**:是的。需要编辑器/Agent CLI 能加载 MCP server;否则只能本地 CLI 使用。 - **每次都会全量读取仓库吗?**:文档目标相反:首次构建后增量更新,并在审阅时只返回最小必读上下文。 - **最快的上手路径?**:用 pipx 安装后执行 `install --platform `,重启工具,再运行 `build`。 ## 来源与感谢 > Source: https://github.com/tirth8205/code-review-graph > License: MIT > GitHub: ⭐ 16380 · forks 1781 --- Source: https://tokrepo.com/en/workflows/code-review-graph-mcp-context-for-smarter-reviews Author: MCP Hub