TypeScript AST MCP Server
Analyzes React component structures in TypeScript projects, including props, data attributes, and click handlers, via the component_tree tool.
Provides tools for analyzing TypeScript codebases, including finding references to class methods, discovering dependencies, and generating component trees.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TypeScript AST MCP ServerFind all files that import theaxioslibrary."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: agent-workspace-mcp
Prerequisites
Node.js (version compatible with the project)
Yarn package manager
Setup
Clone the repository
Install dependencies:
yarn installCopy the example configuration files:
cp .env.example .envUpdate
.envwith your project's tsconfig path:PROJECT_TSCONFIG_PATH=/path/to/your/project/tsconfig.json
How to Run
Build the project:
yarn buildTest the MCP server:
yarn test:mcpThis 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 buildConfigure 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 buildTest 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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceTypeScript-based MCP server designed to enhance code editing experiences by providing features such as hover information, code completion, and diagnostics.31426MIT
- AlicenseAqualityDmaintenanceA TypeScript-aware MCP server that provides coding agents with repository discovery, code intelligence, and web project context for local codebases. It enables deep symbol navigation, diagnostic reporting, and structural analysis of monorepos without requiring full IDE integration.7181MIT
- AlicenseNot gradedqualityDmaintenanceAST-aware TypeScript/JavaScript codebase exploration for AI agents, providing high-precision symbol resolution, reference finding, and structural analysis via MCP tools.223MIT
- FlicenseBqualityDmaintenanceMCP server for TypeScript type resolution and dependency graph analysis using ts-morph and madge.81
Related MCP Connectors
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…
Scan any public GitHub MCP-server repo for security issues. 37 MCP-specific L1 rules, 8 languages.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jscoobyced/jsc-typescript-ast-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server