io.github.jscoobyced/jsc-typescript-ast-mcp
AST for TypeScript, supports creating JSON representations of React components
Que pouvez-vous faire avec io.github.jscoobyced/jsc-typescript-ast-mcp ?
- 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.
Installation
Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).
jsc-typescript-ast-mcpclaude mcp add jsc-typescript-ast-mcp -e 'PROJECT_TSCONFIG_PATH=<PROJECT_TSCONFIG_PATH>' -- npx -y jsc-typescript-ast-mcp@1.1.8
{
"mcpServers": {
"jsc-typescript-ast-mcp": {
"command": "npx",
"args": [
"-y",
"jsc-typescript-ast-mcp@1.1.8"
],
"env": {
"PROJECT_TSCONFIG_PATH": "<PROJECT_TSCONFIG_PATH>"
}
}
}
}
Variables d'environnement
PROJECT_TSCONFIG_PATHobligatoire The path to your TypeScript project's tsconfig.json file
Documentation
Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.
Sommaire
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.
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
- Clone the repository
- Install dependencies:
yarn install - Copy the example configuration files:
cp .env.example .env - Update
.envwith your project's tsconfig path:PROJECT_TSCONFIG_PATH=/path/to/your/project/tsconfig.json
How to Run
Build the project:
yarn build
Test the MCP server:
yarn test:mcp
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:
- Build the server:
yarn build - Configure Claude Code:
- Copy the
.mcp.example.jsonto.mcp.json(or update your existing one with the content of the MCP configuration) - Edit your
.claude/settings.local.jsonand add the MCP section (or the subset needed if you already have some MCPs configured)
“enableAllProjectMcpServers”: true,
“enabledMcpjsonServers”: [
“typescript-ast”
]
- Start Claude Code
- Type the
/mcpcommand and check the MCP is connected
Development
Update the code:
- Make changes to the TypeScript source files in
src/ - Build the project:
yarn build - Test the changes:
yarn test:mcp
Environment Variables
The server uses the following environment variable:
PROJECT_TSCONFIG_PATH: Path to the tsconfig.json file to use for project analysis (defaults to 'tsconfig.json')
Example Configuration Files
.env.example: Example environment variables file.mcp.example.json: Example MCP configuration file (if applicable)
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
Questions fréquentes
Qu'est-ce que io.github.jscoobyced/jsc-typescript-ast-mcp ?
AST for TypeScript, supports creating JSON representations of React components
Comment installer io.github.jscoobyced/jsc-typescript-ast-mcp ?
Il s'exécute sur votre machine. Dans Claude Code : claude mcp add jsc-typescript-ast-mcp -e 'PROJECT_TSCONFIG_PATH=<PROJECT_TSCONFIG_PATH>' -- npx -y jsc-typescript-ast-mcp@1.1.8. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.
Faut-il une clé API pour io.github.jscoobyced/jsc-typescript-ast-mcp ?
Oui. Il attend PROJECT_TSCONFIG_PATH, à renseigner dans sa configuration.
io.github.jscoobyced/jsc-typescript-ast-mcp est-il open source ?
Oui. Son code est sur GitHub sous licence MIT.
Qui maintient io.github.jscoobyced/jsc-typescript-ast-mcp ?
Il est publié par jscoobyced. AI.tn le référence sans le maintenir ni le recommander.
Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.