code-review-graph:本地代码知识图谱接入 MCP
code-review-graph 是一个本地优先的开源工具,用 Tree-sitter 把代码库解析成函数、类、导入、调用与测试覆盖等节点和边,再通过 MCP 向 AI 编程工具提供精简的评审上下文,让助手只读取改动真正影响到的文件。项目方称,在所测 6 个开源仓库中,单次提问所需 token 相对整库基线中位数减少约 63 倍(区间 35–358 倍);约 3000 文件的仓库冷启动索引约 40 秒,两文件改动的增量更新约 2.5 秒。它还提供 GitHub Action,在 PR 上以一条置顶评论给出风险评分函数、受影响执行流与测试缺口,可选地作为合并门禁。
它体现了 agent 上下文供给的一个方向:不再把整个代码库塞给模型,而是用结构化图谱按需切片,从而压低 token 成本。
Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

code-review-graph
A local code knowledge graph that gives AI coding tools precise review context over MCP.
#code-review-graph#Model Context Protocol#Tree-sitter#GitHub Actions#Claude Code#Cursor#Codex#Gemini CLI#GitHub Copilot