RepoWeaver
MCP server that builds a local code intelligence layer, letting AI agents explore call graphs, blast radius, and source slices via a single tool without external APIs.
README
RepoWeaver
Code context fabric for AI coding agents — deterministic call-graph indexing, hybrid retrieval, and a single-tool MCP interface.
RepoWeaver builds a local, zero-cost code intelligence layer that lets AI coding agents (Codex, Claude Code, and other MCP clients) answer structural questions without reading entire files.
"Who calls this method, and what would break if I change its signature?"
→ explore(query, task="impact", repo=".", max_tokens=4000)
→ [verbatim source slices + call paths + blast radius + known blind spots]
Why
AI agents that rely on grep or full-file reads waste tokens and miss cross-file call chains. Existing tools either require cloud APIs, embed LLMs in the index layer, or carry restrictive licenses. RepoWeaver takes only the verified-consensus patterns from the landscape and assembles them locally.
Design
Six primitives, all independently validated across multiple open-source tools:
| # | Primitive | Validated by |
|---|---|---|
| 1 | tree-sitter deterministic parsing, local $0 | CodeGraph · GitNexus · Graft · Aider |
| 2 | Call / inherit / import edges + blast-radius | CodeGraph · GitNexus · Graft · CodeQL |
| 3 | BM25/FTS + PageRank graph diffusion | Graft · CodeGraph · Aider |
| 4 | Content-hash incremental freshness | Graft · Codebase-Memory · CodeGraph |
| 5 | MCP single strong tool explore() |
CodeGraph (empirically validated) |
| 6 | AGENTS.md protocol injection + edit hook | GitNexus · CodeGraph · Graft · Potpie |
Not included: LLM in the index layer (rejected by every serious tool), code sent to external APIs, opinionated semantic summaries.
Roadmap
| Milestone | Tag | Status |
|---|---|---|
| M1 — Fabric MVP (Java parser + edges + FTS5 + PageRank + MCP) | v0.1.0 | ✅ shipped |
| M2 — Freshness & confidence (auto-sync + disambiguation + confidence edges) | v0.2.0 | ✅ shipped |
| M3 — Type precision overlay (SCIP/jdtls) | v0.3.0 | planned |
| M4 — Runtime overlay (OTel/Jaeger trace → edge weights) | v0.4.0 | planned |
Each milestone ships a fabric verify --level mN gate that runs in CI.
Verification approach
Benchmarks use public repos only — no proprietary code enters this repository.
| Benchmark repo | Purpose |
|---|---|
spring-projects/spring-petclinic |
Spring DI-heavy, tests injection-aware edges |
google/gson |
Comparable to CodeGraph's published 93.3% Java coverage |
square/okhttp |
Call-chain depth |
mybatis/mybatis-3 |
Generated-code noise filtering |
SOTA alignment — measured, not claimed
RepoWeaver ships a reproducible benchmark harness and refuses to count low-confidence or ambiguous edges as resolved coverage.
Pinned commit dae37cf…; apples-to-apples scope gson/src/main/; both source
and target files must be inside the scope.
| Metric | v0.1 whole-repo baseline | RepoWeaver v0.2 core | CodeGraph 1.5 core | Gate |
|---|---|---|---|---|
| Resolved cross-file dependent coverage | 35.3% | 90.12% | 92.59% | >=90% |
| Ambiguous edge rate | 89.3% | 6.36% | not exposed | <=10% |
| Fixture edge precision / recall | 1.0 / 1.0 | 1.0 / 1.0 | not measured | >=.95 / >=.90 |
RepoWeaver passes its release gates and is in the same measured coverage band, while remaining 2.47 percentage points behind CodeGraph on this benchmark. We therefore claim alignment, not universal superiority. Coverage cannot be improved by adding ambiguous edges: the gate pairs it with ambiguity and fixture precision.
fabric verify --level benchmark
fabric benchmark run --repo /path/to/gson --name gson \
--scope-prefix gson/src/main/ --output gson.json
fabric benchmark compare --candidate gson.json --target benchmarks/sota-targets.yaml
See benchmark methodology, the checked-in RepoWeaver v0.2 baseline, and the CodeGraph 1.5 comparison.
Install
git clone <this-repo> && cd repoweaver
uv sync --extra dev
uv run fabric build /path/to/your/java/repo # index a repo, $0, no LLM
uv run fabric check /path/to/your/java/repo # OK | STALE (content-hash freshness)
uv run fabric init /path/to/your/java/repo # inject AGENTS.md protocol block
uv run fabric watch /path/to/your/java/repo # OS-event auto-sync, 2s debounce
uv run fabric verify --level m2 # watcher + incremental consistency gate
uv run fabric serve # start the MCP server (explore() tool)
v0.2.0 supports Java only, via tree-sitter. M2 adds conservative overload/type
resolution, REFERENCES, annotation symbols, unresolved-candidate storage,
framework entry-point metadata and auto-sync. No LLM or external network call
is made at runtime.
MCP tool
explore(
query: str,
task: "understand" | "impact" | "locate" | "debug",
repo: str = ".",
max_tokens: int = 4000
) → {
query, task, repo,
slices: [{node_id, file, span_start, span_end, source, qualified_name, confidence, provenance}],
stats: {nodes_visited, edges_traversed, tokens_estimated, freshness},
blind_spots: "<frozen incompleteness contract string>",
# task == "impact": + blast_radius: [{depth, node_id, qualified_name, file, edge_type, confidence, risk}]
# task == "debug": + call_path: [{step, node_id, qualified_name, file, edge_type, confidence}]
}
See docs/explore-contract.md (frozen v1.1) for the full contract.
Acknowledgements
Design patterns drawn from (not forked from): CodeGraph · Graft · GitNexus · Serena · SCIP · Aider
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。