
Jsc Typescript Ast Mcp
io.github.jscoobyced由 GitHub 帳號 jscoobyced 發布v1.0.10更新於 Nov 3, 2026
AST for TypeScript, supports creating JSON representations of React components
概覽
本機 MCP 伺服器,以 ts-morph 解析 TypeScript 專案,讓助理找出方法參照、函式庫相依與 React 元件樹。
- 可以做什麼
- 找出某個類別方法的全部參照,回傳檔案路徑與行號
- 列出匯入指定函式庫相依的檔案
- 從進入點檔案分析 React 元件結構,輸出含 props、data-id 與 onClick 中繼資料的 JSON 樹
- 適用情境
- 適合在 TypeScript 或 React 程式碼庫中工作時使用:讓助理追蹤方法在哪些地方被呼叫、查看哪些檔案相依於某個函式庫,或整理元件階層,而不必手動搜尋。
- 執行需求
- 以 npm 套件形式透過 stdio 在本機執行,需要 Node.js 與 Yarn。必須設定環境變數 PROJECT_TSCONFIG_PATH 指向專案的 tsconfig.json(Vite 專案可能需要 tsconfig.app.json)。未宣告任何驗證。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Jsc Typescript Ast Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
TypeScript AST MCP Server
A Model Context Protocol (MCP) server that provides TypeScript AST (Abstract Syntax Tree) analysis capabilities. This server allows you to find references for classes and methods, analyze component trees, and find dependencies in TypeScript code using the ts-morph library. Great to represent JSON structure of your React components.
Features
- MCP Server: Implements the Model Context Protocol for integration with AI assistants
- TypeScript Analysis: Uses ts-morph for powerful TypeScript AST parsing and analysis
- Reference Finding: Find all references to a given class method in your codebase
- Dependency Finding: Use the
find_dependencytool to list all files that import a specified library. - Component Tree Analysis: Use the
component_treetool to analyze React component structures in your codebase. - The tools are part of the MCP server and can be invoked via Claude Code or other MCP clients.
Prerequisites
- Node.js (version compatible with the project)
- Yarn package manager
Setup
- Create
.envwith your project's tsconfig path:
How to Run
Add this package as dependency and run
This will start the MCP server that can be connected to by MCP-compatible clients.
Installing in Claude Code
To use this MCP server in Claude Code:
- Configure Claude Code:
- Copy a
.mcp.json(or update your existing one with the content of the MCP configuration):
For the project path, if you're using Vite you might want to use the tsconfig.app.json instead.
- Edit your
.claude/settings.local.jsonand add the MCP section (or the subset needed if you already have some MCPs configured)
- Start Claude Code
- Type the
/mcpcommand and check the MCP is connected
Tool Descriptions
The server provides three tools:
1. find_reference
Find all references to a given class method in your codebase.
- Input:
filePath: Path to the fileclassName: Name of the classmethodName: Name of the method
- Output: List of file paths with line numbers where the method is referenced
2. find_dependency
List all files that import a specified library.
- Input:
dependencyName: Name of the dependency to search for
- Output: List of file paths that import the specified dependency
3. component_tree
Analyze React component structures in your codebase.
- Input:
entryFilePath: Path to the entry filemaxDepth: Maximum depth of the component tree (default: 3)data-id(optional): Attribute name to capture intoTreeNode.dataId(example:data-attribute-id)
- Output: JSON representation of the component tree structure, including optional element metadata such as
props,dataId, andonClick
License
MIT
來源:code/README.md,提交 ad97145
工具
0版本歷史
1- v1.0.10最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分