MCP AST Explorer

io.github.LovRanRan由 GitHub 帳號 LovRanRan 發布v0.1.0更新於 Oct 24, 2026

Python symbol exploration for codebase onboarding agents.

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

概覽

AI 產生的概覽

一個本機 MCP 伺服器,以 LibCST 索引 Python 原始碼,讓助理查詢定義、簽章、參照、呼叫端與子類別。

可以做什麼
尋找 Python 檔案中模組、類別、函式與方法的定義,並回傳簽章與同模組內的名称參照。追蹤函式或方法的直接呼叫端,列出類別的直接子類別。對缺少的符號或不支援的語言回傳結構化結果,而不是憑空作答。提供健康檢查供快速驗證。
適用情境
適合助理在熟悉 Python 程式碼庫時使用,需要以符號為依據回答某處如何定義、被誰呼叫或誰繼承了它。也適合與儲存庫結構對應、測試執行類伺服器搭配,用於程式碼庫入門流程。
執行需求
以本機 stdio 程序執行,從 PyPI 套件 mcp-ast-explorer 安裝,文件中的安裝步驟使用 uv。僅解析 Python 檔案;未宣告帳號、API 金鑰或環境變數。
安裝前請注意
v1 僅支援 Python,TypeScript 只是預留位置、尚未實作。不解析跨檔案匯入、別名、星號匯入、限定參照與動態屬性存取,呼叫鏈與類別階層只回傳直接關係,結果可能不完整。它會讀取本機原始碼檔案,請只指向願意讓助理看到的程式碼。

安裝

在 SourceWeft 中

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

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mcp-ast-explorer

MCP server for deterministic Python codebase symbol exploration.

mcp-ast-explorer indexes Python source files with LibCST and exposes focused MCP tools for codebase onboarding: definition lookup, function signatures, local references, direct call chains, and simple class hierarchy queries.

Codebase Onboarding Stack

mcp-ast-explorer is the semantic symbol layer in a three-server MCP tool stack for Project 6 wayfinder, a codebase onboarding agent.

  • mcp-repo-mapper maps repository structure, languages, entry points, framework evidence, and Python dependency edges.
  • mcp-ast-explorer provides symbol-grounded Python definition, signature, reference, call-chain, and class-hierarchy lookups.
  • mcp-test-runner runs local pytest/Jest checks and coverage summaries so agent claims can be verified against execution.

In wayfinder, this server feeds entry-point and symbol explanation while refusing to invent missing symbols.

Status

This is a Python-only v1. TypeScript is registered as an unsupported backend placeholder so the server has an explicit extension point, but TypeScript analysis is not implemented yet.

The server does not use an LLM for symbol lookup. If a requested symbol or class is not present in the parsed index, tools return a structured not-found result instead of inventing an answer.

Tools

ToolPurpose
health()Returns ok for smoke checks.
find_definition(path, symbol, language="python")Finds a module, class, function, or method definition.
function_signature(path, symbol, language="python")Returns the signature for a function or method symbol.
find_references(path, symbol, language="python")Returns same-module CST name references for an existing symbol.
call_chain(path, from_symbol, depth=2, language="python")Returns direct callers detected from local references.
class_hierarchy(path, class_name, language="python")Returns direct subclasses detected from simple base-class names.

Supported Scope

  • Python files parsed by LibCST.
  • Symbol kinds: modules, classes, functions, and methods.
  • Same-module reference lookup for simple names.
  • Direct caller detection from function or method containers.
  • Direct subclass detection for simple class Child(Base): inheritance.
  • Structured error responses for unsupported languages and missing symbols.

Current Limitations

  • Cross-file imports and package-wide resolution are out of scope for v1.
  • Aliases, star imports, dynamic attribute access, and qualified references are not resolved.
  • call_chain currently returns direct callers only; recursive multi-hop expansion is not implemented.
  • class_hierarchy currently returns direct subclasses only and handles simple base names.
  • TypeScript is intentionally unsupported in v1.

Local Development

Install dependencies:

bash
uv sync --extra dev

Run the MCP server:

bash
uv run mcp-ast-explorer

Run verification:

bash
uv run ruff check .uv run mypyuv run pytest

License

MIT

來源:README.md,提交 8126b9f

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

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

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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