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.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,提供大型程式碼庫的靜態架構分析,讓助理取得行為邊界、耦合接縫與孿生程式碼脈絡。

可以做什麼
以儲存庫內的行為模式為提示提供依據:任務指紋、行為孿生檢索,並針對所描述的任務回傳孿生候選、接縫建議與評分清單(task_fingerprint、behavioral_twins、twin_context)。讀取預先產生的架構產物(bgi-graph.json、fuse-graph.json),呈現元件邊界、高耦合接縫以及叢集之間的融合邊界訊號。支援重構與整合風險類問題,指出邊界可能應處的位置以及哪些子系統耦合具有風險。
適用情境
適用於在大型程式碼庫中工作、希望助理在重構或新增功能前分析元件邊界、風險耦合與既有行為模式的場合。它著重於原始碼的靜態分析,而非執行時行為。
執行需求
以本機程序在使用者機器上執行(僅桌面端),從 PyPI 安裝 bigindexer,並以 bgi mcp 指令啟動。需要先由掃描產生的架構產物,以 graph 與 fuse-graph 檔案傳入。需要 Python 與 pip;未宣告任何帳號、API 金鑰或標頭。
安裝前請注意
伺服器讀取掃描儲存庫所產生的產物,這些檔案應視為源自原始碼的資料。遙測為選用且預設關閉;若透過 BGI_TELEMETRY 啟用,會傳送版本、作業系統、儲存庫規模區間及 git remote 的短雜湊,不會傳送檔案路徑、原始碼、儲存庫名稱或身分資訊。分析為靜態且基於啟發式,完整的外部精確率/召回率尚未公布。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Big Indexer,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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.

bash
pip install bigindexer==0.1.3bgi mcp --graph bgi-graph.json --fuse-graph fuse-graph.json

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

  1. "Where should this boundary be before we refactor?"
    BGI groups units by behavioral role (COV tokens + DRS clustering) so likely component boundaries are visible.
  2. "Which subsystem coupling is risky?"
    BGI surfaces high-coupling seams and fuse-boundary signals between clusters so integration risk is easier to spot.
  3. "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).
  4. "How do we make AI changes less random?"
    MCP tools (task_fingerprint, behavioral_twins, twin_context) ground prompts in in-repo behavior patterns.
  5. "Can I run this automatically on PRs as a live example?"
    Yes — use the dedicated action repo ahmedxuhri/bigindexer-pr-risk-bot to auto-comment PRs with blast radius, seams, and risk hints.

30-second demo

Run BGI on the included fixture repo:

bash
git clone https://github.com/ahmedxuhri/bigindexercd bigindexerpip install -e .bgi scan tests/fixtures --lang python --out /tmp/bgi-example.jsonhead -50 /tmp/bgi-example.json

Observed result on this repository:

  • units: 12
  • edges: 14
  • clusters: 2
  • max cluster in sample: 6 units

One produced edge looks like:

json
{  "source": "auth_module.py::AuthService::__init__",  "target": "auth_module.py::AuthService::__del__",  "key": "COV.INIT",  "lock": "COV.TEARDOWN",  "type": "HARD"}

Why this matters: instead of raw syntax references only, you get behavioral relationships plus cluster structure that can drive architecture decisions.


Plain-English glossary

BGI termPlain meaning
COV tokenA behavior label for a unit (for example: FETCH, PERSIST, AUTHENTICATE)
Key-Lock edgeA behavioral connection between two units with complementary roles
DRS clusterA unit-level grouping by behavioral role. Mostly intra-file in practice. File-level architectural components are better expressed via the BGI edge graph or the fuse-graph boundary signal — see external benchmark
Fuse edge / fuse eventA refused merge because cluster growth hit the cap; treated as boundary signal
Spectral masksScope rules that limit where matching is allowed (global, directory, file)

Architecture in one view

text
Source files   ->Gate 1: fingerprint unit behavior (COV tokens)   ->Gate 2: create behavioral edges with scoped matching   ->Gate 3: cluster with hard size cap + boundary emission   ->Artifacts: bgi-graph.json, fuse-graph.json, bigindexer.md, optional routes/graphml/html

Core approach:

  1. TOKEN-CENSUS - classify token frequency per repo.
  2. SPECTRAL-MASKS - restrict match scope by token frequency.
  3. FUSE-MAP - cap cluster growth and record refused merges.
  4. MASK-4-GATE-3 - use import proximity as clustering signal.
  5. WATER-CLOCK + .scm - single-pass query extraction path in Gate 1.

Why BGI is different from common alternatives

CapabilityLSP / SCIP indexCall-graph + generic community detectionBGI
Fast symbol lookupStrongMediumAvailable (Phase 6 index)
Behavioral token modelNoUsually noYes
Hard-bounded clusteringNoUsually noYes (unit-level)
First-class boundary artifactNoUsually noYes (fuse-graph.json)
Scope-constrained edge generationLimitedRareYes (spectral masks)

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/p02 miss.
  • 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:

  1. Query-backed (.scm): python, typescript, tsx, javascript, go, rust, java, csharp, php, ruby, kotlin, scala
  2. Tree-sitter scanner + rule path: c, lua, elixir
  3. 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

  1. BGI is static analysis; it does not ingest runtime traces.
  2. Cross-file semantic resolution is heuristic and language-dependent.
  3. Cluster-size health is measured; full external precision/recall is not yet published.
  4. Shared-host benchmarking introduces variance; decisions should use controlled medians.

Install

bash
pip install -e .

Quickstart commands

bash
# scanbgi scan /path/to/repo --lang auto --out bgi-graph.json
# optional outputsbgi scan /path/to/repo --lang auto \  --fuse-graph fuse-graph.json \  --routes routes.json \  --graphml graph.graphml \  --html
# incrementalbgi scan /path/to/repo --lang auto --incremental --cache .bgi-cache.json
# diffbgi diff /path/before /path/after --lang auto --out diff.json
# run MCP server over generated artifactsbgi mcp --graph bgi-graph.json --fuse-graph fuse-graph.json

Example MCP usage pattern (from your client prompt):

text
Use MCP tool twin_context for:"Add endpoint that validates input and persists data."Return top twin candidate, seam suggestion, and rubric checklist.

Telemetry

BGI ships with opt-in, off-by-default anonymous telemetry. To enable:

bash
export BGI_TELEMETRY=1bgi mcp --graph bgi-graph.json --fuse-graph fuse-graph.json

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 invariants
  • docs/LANGUAGE_SUPPORT.md - language implementation details
  • docs/CONTRIBUTING_LANGUAGES.md - language contribution guide
  • docs/INDEX_SCHEMA.md - interactive index schema
  • docs/QUERY_PLANNER.md - query planner scoring
  • docs/MCP_SETUP.md - MCP server setup and usage
  • docs/MCP_WITH_CONTINUE.md - 5-minute Continue + BGI walkthrough
  • docs/TELEMETRY.md - opt-in telemetry: what we collect and how to disable
  • https://bigindexer.com/validation - public validation evidence
  • docs/MCP_QUICKSTART_DEMO.md - 5-minute demo walkthrough
  • docs/MCP_EXAMPLE_TRANSCRIPTS.md - real-world MCP tool invocation examples
  • docs/MCP_REAL_TRANSCRIPT.md - unedited transcript from FastAPI analysis
  • scripts/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
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分