
Automatised Pipeline
io.github.cdeust由 GitHub 帳號 cdeust 發布v0.8.4更新於 Oct 25, 2026
Codebase intelligence MCP server — index any repo into a property graph; 26 tools for agents.
概覽
將本機程式碼倉庫索引成程式碼圖,讓助理搜尋符號、追蹤呼叫與被呼叫關係、評估影響並對應程式碼差異。
- 可以做什麼
- 將倉庫索引並分析成本機程式碼圖,可選擇搭配語言伺服器與執行時追蹤,並回報未涵蓋的部分。搜尋符號與文件,依完整名稱檢視符號的呼叫者、被呼叫者、匯入與社群,並執行唯讀圖查詢。評估反向相依與影響範圍,列出從進入點出發的執行流程,並把 git 差異對應到受影響的符號。加入 git 歷史、檢查安全閘門、比較前後兩張圖,並用圖驗證 PRD 或文件中的陳述。匯出圖事實,並記錄附帶澄清紀錄的發現項目。
- 適用情境
- 適合需要關於程式碼庫的結構性答案時使用,例如誰呼叫了某個函式、某次改動影響哪些部分、文件陳述是否與程式碼一致,避免反覆讀取檔案。最適合 Rust、Python、TypeScript、Java、Kotlin、Swift、Objective-C、C、C++ 與 Go 倉庫。
- 執行需求
- 以本機 stdio 程序在使用者機器上執行,僅限桌面端。可透過 Claude Code 外掛、cargo install 安裝,或以 Rust 1.95.0 與 CMake 從原始碼建置。外掛需要 GitHub CLI 2.68 或更新版本。每次呼叫需傳入輸出目錄;選用的語言伺服器環節需要 rust-analyzer、pyright 或 typescript-language-server。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Automatised Pipeline,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[ai-architect-mcp-codebase, a code-graph MCP server]
[MIT License] [Rust 1.95.0, pinned by rust-toolchain.toml] [27 MCP tools] [3200+ tests] [93% line coverage] [OpenSSF Best Practices] [11 languages]
An MCP server that indexes a repository into a local code graph and answers structural questions about it: who calls this, what depends on it, what a diff touches, how execution reaches a function.
What it is · Install · First session · Tools · Limits · Development
What it is
ai-architect-mcp-codebase parses a repository with tree-sitter, stores the
symbols and their relationships (definitions, calls, imports, implementations,
uses) in an embedded LadybugDB graph database on your machine, and exposes
that graph to an agent through MCP tools. An agent can search the graph, look
up a symbol with its callers and callees, list the reverse dependencies of a
symbol, follow execution flows from entry points, map a git diff onto the
symbols it changes, and compare two graphs of the same code. Answers about
symbols carry source locations and the limits of the analysis behind them.
The server does not edit the files it indexes. It writes its graph and
sidecar files under the output_dir you pass, plus a snapshot in the
repository only when you ask for the team-shared artifact. Indexing and queries
run locally without network calls, no language model reads the code, and
nothing is uploaded. The graph is a directory you own.
The graph comes from static parsing of source text, so some things stay out
of it. A call made through reflection, dynamic dispatch, generated code, or a
macro the parser does not expand has no edge unless an optional
language-server pass (lsp: true) or runtime traces (ingest_traces) supply
one. Method calls through a receiver are resolved statically only for the
receiver shapes listed below; the rest need
the language-server pass. Ruby gets a shallow extraction with no imports or
visibility. Process flows are reachability in the graph from declared entry
points, capped at depth 20, with no observation of execution. An empty answer
can mean "no such relationship" or "not indexed", and the coverage report
exists to tell those apart.
Install and register
Claude Code plugin
The plugin downloads the release binary and verifies its Sigstore provenance
before running it; this needs GitHub CLI 2.68 or newer. The plugin starts the
full profile unless AP_PROFILE=core is set.
Other MCP hosts
install detects Claude Code, Codex CLI, Gemini CLI, Cursor, VS Code and Zed,
adds only its own entry to each config file, and never overwrites a file it
cannot parse. --dry-run previews the changes; uninstall removes them. To
configure a host by hand, register the binary as a stdio server:
docs/install.md has the per-host snippets (Codex, Gemini, Cursor, Windsurf, VS Code, the OpenAI Agents SDK), the optional Grep/Glob hook, the plugin's release verification, and the developer escape hatch for running a local build inside the plugin.
Build from source
Rust 1.95.0 is pinned by rust-toolchain.toml, and
CMake is required.
Tool profiles
The server registers one of two tool sets, chosen at startup with --profile
or the AP_PROFILE environment variable (the flag wins).
The default stays full until the next major version, because shrinking the
default tool surface is a breaking change. New agent setups should use the
core profile (8 read-only tools): analyze_codebase already runs index,
resolve and cluster in one call, and leaving out the 19 hidden tools keeps the
tool prompt small.
A first session
Re-run analyze_codebase after edits; indexing is incremental by default.
27 MCP Tools
Each tool takes JSON arguments checked against its JSON Schema and returns
structured JSON, with a named reason code on error. No tool calls a language
model. Agent installs rarely need all 27; the core profile registers just
the 8 code-intelligence tools.
validate_prd_against_graph, prepare_prd_input and the finding-record tools
produce or check JSON artifacts on disk under the output_dir a call names. A specification tool such as
ai-architect-mcp-spec, or any other consumer, can read
them; the server itself has no dependency on the consumer.
The verification verdicts have narrow meanings. check_security_gates returns
gates_passed: true when no check raised a critical flag, and
report.assessment_complete separately; the latter is false for an empty
symbol list, a skipped check, or changed symbols that could not be resolved.
The unsafe-symbol check is skipped until the Rust parser records unsafe.
Neither field certifies security. A clean verdict from
verify_semantic_diff needs a regression score below the threshold and no new
unresolved import, and says nothing about behavioural equivalence or
compilation; tests, the compiler or proofs establish those. A finalized
clarification digest binds the recorded transcript bytes and does not
establish that the finding is true.
How answers state their limits
The read tools report what they could not see next to what they found. The 0.12.0 entry of the CHANGELOG has the detail for the coverage, impact, language-server, receiver-resolution and freshness items below.
Coverage report
analyze_codebase, index_status and query_graph(graph: "missed") report
files that were parse_incomplete, skipped or quarantined, plus three
Rust buckets added in 0.12.0. outside_build_targets lists indexed .rs
files outside every compiled Cargo target according to
cargo metadata --no-deps (a Kani proof file, an excluded fuzz/ directory).
feature_gated lists modules reached only through a mod declaration whose
#[cfg(feature = ...)] is false under default features. unlinked_file lists
files rust-analyzer itself reports as belonging to no crate, recorded when an
LSP pass opens them. cargo_attribution.status says whether the two
Cargo-derived buckets were determined: known, unknown (the cargo metadata call failed or cargo is missing, so an empty bucket means "not
determined"), not_applicable, or not_recorded for an older record.
coverage.pruned_dirs names every directory the walk skipped by policy, with
its reason. An empty coverage report is still not proof of completeness.
Epistemic boundary on impact
get_impact labels its answer exact only when the coverage record has zero
gaps in every bucket, cargo_attribution.status is not unknown, and no
unresolved call site names the target. Otherwise the answer is lower-bound, with reasons.
unresolved_callsites_naming_target counts unresolved call sites whose callee
names the target, and unresolved_callsites_outside_targets counts those in
files outside the compiled Cargo targets, so an empty caller list can be told
apart from a symbol with no callers.
Language-server pass
With lsp: true, analyze_codebase reports lsp_status.state as disabled,
completed, completed_unresolved (sites needed resolving and none were
resolved) or failed. A Rust crate nested under a Cargo workspace that does
not list it as a member fails the pass with lsp_workspace_load_failed, naming
the Cargo-level fix, before any resolution request is sent. Analysis continues
on the available graph when the pass fails. server_health carries the language
server's own last-reported health.
Static receiver-call resolution
Since 0.12.0 the static resolver binds self.m() and Self::m() in Rust,
self.m() in Python and this.m() in TypeScript to the enclosing type's
method (resolution_method: "receiver-type"). In Rust it also binds x.m()
when x is bound once in the enclosing function by a typed parameter, a typed
let, or let x = T::assoc(..) ("receiver-local-binding"). It also
types x from the declared return type of a free function of the same file
that initialised it (let x = make();, and an Option or Result unwrapped by
let Some(x) = .. else, .expect(..), .unwrap() or ?), at a lower
confidence ("receiver-return-type", 0.85). A receiver it cannot type is left
unresolved; it never falls back to a lookup by bare name.
Query truncation and paging
query_graph bounds a query with no LIMIT of its own to 500 rows per page
(limit_injected: true). truncated is true whenever more rows exist after
the page, and next_offset reads the next one. When the row bound cut the
result, total_count is a lower bound. Paging is stable only when the query
declares ORDER BY, which order_stable reports. The tool's JSON Schema
description has the full contract.
Freshness receipt
search_codebase, get_symbol and get_impact return graph_freshness
(state: fresh | stale | unknown, dirty_files, checked_files,
commits_behind, commits_ahead) on every response, errors included, so an
answer from a graph older than the working tree is marked as such. A graph
indexed by 0.11.x reads unknown until it is re-indexed.
Languages
Rust, Python, TypeScript (and JavaScript through the TSX grammar), Java,
Kotlin, Swift, Objective-C, C, C++ and Go get deep extraction through a
per-language spec: definitions, calls and imports, plus visibility and type
relationships where the spec records them. Ruby is a shallow tier
(ADR-0056): functions,
methods, classes and modules, and calls, with no visibility and no import
edges (require appears as a call). Other files, documentation and
configuration included, are indexed as File nodes. The text of documentation
files (md, markdown, mdx, txt, rst, adoc, up to 256 KiB) is
searchable through BM25. The language-server pass supports Rust, Python and TypeScript.
Security model
The server enforces read-only access to the graph in query_graph with two
layers. The engine's compiled-plan check refuses database writes, and a
lexical gate refuses the filesystem statements the engine classifies as
read-only (COPY … TO, EXPORT DATABASE, ATTACH, and others), plus every
CALL outside a two-procedure allowlist. Git refs are validated, the
language-server command is limited to four known binaries, the walk has size
and depth limits, and parsing has a per-file deadline. Release binaries carry
Sigstore provenance that the Claude Code plugin verifies before running them.
docs/security.md has the full list and the analysis of
why both query_graph layers are needed, and
docs/ASSURANCE-CASE.md the security argument.
Report vulnerabilities through SECURITY.md.
Green software engineering
The dominant energy cost in an LLM-assisted coding workflow is the model inference spent re-reading files to answer a question a structural query could answer once; this binary's CPU is small next to it. Every token an agent does not process is compute that is never scheduled. The Green Software Foundation calls this energy proportionality, and here it is applied where the constant is largest.
The head-to-head evaluation measures that demand under a pre-registered protocol, n=20, reproducible offline with no API key:
Costs are modeled. Both legs use a payload-size / 4 token proxy, and indexing, client prompts, real MCP response envelopes and model reasoning are excluded. The corpus informed fixes #87 and #92, so this is a regression benchmark. Dividing aggregate payload volumes gives 12.76x, a different statistic. No energy or CO2 figure is derived from these numbers, because this repository measures no joules and a token count does not convert to watt-hours. docs/evaluation.md has the full table, the protocol and the falsified first run.
On the server side, bulk graph writes through UNWIND with a typed struct cost
0.127 ms per edge against 9.658 ms for the naive raw-string path, 76 times
less work for the same output (measured 2026-07-28 on lbug 0.18 with
tests/lbug_bulk_investigation.rs). Tree-sitter extracts structure without a
model, and indexing is incremental by default. The server-side measurements
and their dates are in docs/evaluation.md.
The zetetic standard
Inherited from zetetic-team-subagents.
In this codebase:
- Every algorithm traces to a source. Louvain: Blondel et al. 2008. Leiden C2 repair: Traag et al. 2019. RRF: Cormack, Clarke and Büttcher 2009. Strongly connected components: Tarjan 1972. BM25 (through Tantivy): Robertson et al. 1994.
- Named constants record their source or measured rationale. The RRF
constant
K = 60.0insrc/search/rrf.rscites Cormack 2009;BULK_BATCH_SIZE = 500cites LadybugDB practitioner guidance and the April 2026 scalability audit. CONTRIBUTING.md requires a// source:annotation on every numeric constant with three or more significant digits, and an efficiency claim with no measurement behind it does not ship. - No invented numbers. Where a value was chosen by judgment, the comment says so and gives its operational justification.
- Error responses name the rule that was violated, for example
unsafe finding_id (spec §5.1.4, §9.3 Q4): must not contain '..'. - When a capability is unavailable, the tool says so in plain language. For
example,
lsp_resolveon a binary that is not a language server returnslsp_probe_failed: found on PATH but didn't respond as an LSP server (stdout closed immediately; likely a stub, proxy, or non-LSP binary).
Development
CI also measures line coverage with cargo llvm-cov (80% floor) and checks the
coverage and test-count badges above against that run. Contributions need a
DCO sign-off (git commit -s); CONTRIBUTING.md has the
layer rules and coding standards, and
docs/architecture.md the module map, dependencies and
design records. The evaluation programs are described in
docs/evaluation.md.
Repository layout
Status
Version 0.14.0. The capabilities above are covered by the test suite and the
accuracy gate in CI and have been run end to end on the maintainer's machine;
they have not yet been validated in a production deployment. The unsafe-symbol
security check waits on unsafe extraction in the Rust parser. Rename and
refactor tools are out of scope because the server does not edit code. Direction is in
docs/ROADMAP.md; what shipped is in
CHANGELOG.md.
Related projects
Each of these runs on its own. Cortex is
a persistent-memory MCP server, and
ai-architect-mcp-spec is an
MCP server for PRD generation and specification verification. An agent that
has both this server and ai-architect-mcp-spec registered can ground a
specification in the graph through search_codebase, get_context and
get_impact, or through the JSON file prepare_prd_input writes, and check
the result with validate_prd_against_graph.
License
MIT, see LICENSE. Published on crates.io as
ai-architect-mcp-codebase
and listed in the MCP Registry
under the name below.
mcp-name: io.github.cdeust/ai-architect-mcp-codebase
This software is the independent work of Clément Deust. It was developed outside any employment relationship and is not affiliated with, endorsed by, or owned by any past or present employer.
The graph and retrieval algorithms used here (Louvain community detection with
C2 repair, BM25, RRF rank fusion, tree-sitter parsing, Tarjan strongly
connected components) come from published research; citations are inline in
// source: annotations and in docs/. The MIT license covers this
implementation and asserts no ownership over the underlying algorithms, which
remain attributable to their original authors.
來源:README.md,提交 5c2e138
工具
0版本歷史
1- v0.8.4最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分