
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 分