
Big Indexer
io.github.ahmedxuhri由 GitHub 账号 ahmedxuhri 发布v0.1.2更新于 Oct 24, 2026
Architecture-aware MCP context with boundaries, seams, impact scope, and BGI-TWIN guidance.
概览
一个本地 MCP 服务器,提供大型代码库的静态架构分析,让助手获得行为边界、耦合接缝与孪生代码上下文。
- 可以做什么
- 基于仓库内行为模式为提示提供依据:任务指纹、行为孪生检索,并针对所描述任务返回孪生候选、接缝建议与评分清单(task_fingerprint、behavioral_twins、twin_context)。读取预先生成的架构产物(bgi-graph.json、fuse-graph.json),呈现组件边界、高耦合接缝以及集群之间的融合边界信号。支持重构与集成风险类问题,指出边界可能应处的位置以及哪些子系统耦合存在风险。
- 适用场景
- 适用于在大型代码库中工作、希望助手在重构或新增功能前分析组件边界、风险耦合和既有行为模式的场景。它面向源代码的静态分析,而非运行时行为。
- 运行要求
- 作为本地进程在用户机器上运行(仅桌面端),从 PyPI 安装 bigindexer,并通过 bgi mcp 命令启动。需要先由扫描生成的架构产物,以 graph 与 fuse-graph 文件传入。需要 Python 与 pip;未声明任何账号、API 密钥或请求头。
安装
在 SourceWeft 中
- 打开 控制台中的 Big Indexer,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
BGI - Big Indexer
[ahmedxuhri/bigindexer MCP server] [PyPI version] [License] [Tests] [Interactive Demo] [MCP Registry] [PR Risk Bot Action]
BGI is a static architecture analysis tool for large codebases.
It groups code units by behavioral role and emits explicit architectural boundaries.
Project domain: bigindexer.com
Use via MCP Registry
Big Indexer is published in the MCP Registry as io.github.ahmedxuhri/bigindexer.
Validation: https://bigindexer.com/validation
What problem this solves
Most architecture graphs fail at scale in two ways:
- too many noisy edges
- giant clusters that collapse unrelated components together
BGI is built to keep both under control, so the output remains usable on large repos.
What you can do with it
- "Where should this boundary be before we refactor?"
BGI groups units by behavioral role (COV tokens + DRS clustering) so likely component boundaries are visible. - "Which subsystem coupling is risky?"
BGI surfaces high-coupling seams and fuse-boundary signals between clusters so integration risk is easier to spot. - "How do we plug architecture data into automation?"
BGI emits machine-readable artifacts (bgi-graph.json,fuse-graph.json) plus optional human context (bigindexer.md). - "How do we make AI changes less random?"
MCP tools (task_fingerprint,behavioral_twins,twin_context) ground prompts in in-repo behavior patterns. - "Can I run this automatically on PRs as a live example?"
Yes — use the dedicated action repoahmedxuhri/bigindexer-pr-risk-botto auto-comment PRs with blast radius, seams, and risk hints.
30-second demo
Run BGI on the included fixture repo:
Observed result on this repository:
- units:
12 - edges:
14 - clusters:
2 - max cluster in sample:
6units
One produced edge looks like:
Why this matters: instead of raw syntax references only, you get behavioral relationships plus cluster structure that can drive architecture decisions.
Plain-English glossary
Architecture in one view
Core approach:
- TOKEN-CENSUS - classify token frequency per repo.
- SPECTRAL-MASKS - restrict match scope by token frequency.
- FUSE-MAP - cap cluster growth and record refused merges.
- MASK-4-GATE-3 - use import proximity as clustering signal.
- WATER-CLOCK +
.scm- single-pass query extraction path in Gate 1.
Why BGI is different from common alternatives
External head-to-head benchmark (Louvain on BGI's edges vs Louvain on raw imports, scored against package layout): BGI's edges win on Python (django F1 0.38 vs 0.29, MoJoFM 0.45 vs 0.34) and currently tie/lose on Go due to lower cross-file edge density on tier-2 scanners. Full results and methodology in docs/VALIDATION_EVIDENCE.md.
Evidence (current, verifiable)
Large-repo scale evidence
Comparable kubernetes sample (go comparable mode, 162,917 units):
- Gate 1:
141.964s - Gate 2:
67.261s(historical comparable baseline:138.869s) - Gate 3:
9.359s - Total:
218.584s - Max cluster:
1.113% - Fuse events:
0
Artifact: output/validation/kubernetes-optionb-controlled-median-v21.json
Quality guard evidence (beyond raw speed)
- Gate 2 scope safety tests block invalid cross-scope merges (see
tests/test_gate2.py). - Gate 3 tests verify no legacy namespace over-merge without import evidence (see
tests/test_gate3.py). - Current full suite status:
python3 -m pytest tests/ -x -q(project baseline target remains passing).
Evidence summary
- Current published validation set: 100 scored runs across 5 repos and 3 models.
- Full 20-run post-shipment benchmark refresh for BGI-TWIN context (
task → COV → top-3 twins + seam + rubric) is complete: actionability 4.75/5 (p04 slice: 4.8/5), boundary 1.0, hallucinations 0. - Independent-model replication is now complete on azure/gpt-4o (20 runs) and gemini/auto (20 runs): GPT-4o actionability 4.85/5, Gemini actionability 4.25/5, both with zero hallucinations; Gemini boundary 0.95 reflects one genuine
django/p02miss. - Still missing: labeled precision/recall benchmark on an external corpus and head-to-head quantitative benchmark vs external tools on the same labeled dataset.
Language support tiers (explicit)
BGI does not treat all languages equally; support is tiered:
- Query-backed (
.scm):python,typescript,tsx,javascript,go,rust,java,csharp,php,ruby,kotlin,scala - Tree-sitter scanner + rule path:
c,lua,elixir - Generic regex fallback by extension:
swift,r,dart,bash,nim,zig,haskell,ocaml,fsharp,clojure,erlang,matlab,vb,crystal,cobol,groovy
Use this as a reliability signal: query-backed and dedicated scanner tiers are stronger than generic fallback.
Cross-file edge density caveat: the language tiers above describe parser quality. A separate axis is cross-file behavioral edge density — how many key-lock pairs the scanner produces that link units in different files. Tier-1 (.scm-backed) languages produce dense cross-file edges. Tier-2 scanner-backed languages currently produce sparser cross-file edges because their token mix is dominated by structural tokens (INTAKE/OUTPUT/CONDITIONAL/LOOP) that gate-2 deliberately scopes to same-file to prevent O(N²) noise. The user-visible MCP product (boundary detection, twin retrieval, AI-assistant context) still works on tier-2 languages — see the validation evidence — but cluster-recovery benchmarks against import-graph baselines reflect this density gap. Concrete numbers in docs/VALIDATION_EVIDENCE.md.
Limitations and non-goals
- BGI is static analysis; it does not ingest runtime traces.
- Cross-file semantic resolution is heuristic and language-dependent.
- Cluster-size health is measured; full external precision/recall is not yet published.
- Shared-host benchmarking introduces variance; decisions should use controlled medians.
Install
Quickstart commands
Example MCP usage pattern (from your client prompt):
Telemetry
BGI ships with opt-in, off-by-default anonymous telemetry. To enable:
What's collected when enabled: BGI version, OS, repo size bucket, and a 12-char hash of your repo's git remote (so we can deduplicate "same repo seen twice" without ever knowing which repo). What's never collected: file paths, source code, repo names, user identity, or IP addresses. Full schema and disable instructions in docs/TELEMETRY.md.
Documentation map
MEMORANDUM.md- design contracts and invariantsdocs/LANGUAGE_SUPPORT.md- language implementation detailsdocs/CONTRIBUTING_LANGUAGES.md- language contribution guidedocs/INDEX_SCHEMA.md- interactive index schemadocs/QUERY_PLANNER.md- query planner scoringdocs/MCP_SETUP.md- MCP server setup and usagedocs/MCP_WITH_CONTINUE.md- 5-minute Continue + BGI walkthroughdocs/TELEMETRY.md- opt-in telemetry: what we collect and how to disablehttps://bigindexer.com/validation- public validation evidencedocs/MCP_QUICKSTART_DEMO.md- 5-minute demo walkthroughdocs/MCP_EXAMPLE_TRANSCRIPTS.md- real-world MCP tool invocation examplesdocs/MCP_REAL_TRANSCRIPT.md- unedited transcript from FastAPI analysisscripts/mcp-demo.sh- automated demo script for multiple CLIs and repositories
License and Copyright
- License: Apache License 2.0 (
LICENSE) - Contributor terms: Developer Certificate of Origin (
DCO) enforced on pull requests
Legal
Big Indexer is a product of SUDO SOFTWARES LTD, registered in England and Wales (Company No. 16976948). Contact: [email protected] · https://bigindexer.com
来源:README.md,提交 b9b92ed
工具
0版本历史
1- v0.1.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分