# jsc-typescript-ast-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/jscoobyced/jsc-typescript-ast-mcp  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/jsc-typescript-ast-mcp

## Description
An MCP that provides an abstract syntax tree (AST) for TypeScript code using the ts-morph library.

## Tools
Capabilities this server exposes over MCP:

- **filePath** — Path to the file
- **className** — Name of the class
- **methodName** — Name of the method
- **Output** — List of file paths with line numbers where the method is referenced
- **dependencyName** — Name of the dependency to search for
- **entryFilePath** — Path to the entry file
- **maxDepth** — Maximum depth of the component tree (default: 3)

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/jscoobyced/jsc-typescript-ast-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
yarn install
```

2. Configure:

```sh
cp .env.example .env
```

3. Run:

```sh
yarn build
```

## Documentation

## What jsc-typescript-ast-mcp MCP server does

The jsc-typescript-ast-mcp MCP server gives an MCP client access to TypeScript AST analysis for a configured project. It uses ts-morph to parse the project described by a tsconfig.json file, allowing an AI assistant to inspect relationships in the codebase rather than relying only on text searches.

Its supported analysis covers three tasks: locating references to a class method, identifying files that import a dependency, and building a tree of React components starting from an entry file. The results are intended for code navigation, dependency tracing, and understanding component structure.

## How it works

The server reads the project configuration from the path supplied by `PROJECT_TSCONFIG_PATH`. If that variable is not set, the project uses `tsconfig.json` by default. The MCP client sends tool inputs to the server, which analyzes the configured TypeScript project and returns structured results.

`find_reference` accepts a file path, class name, and method name. It returns file paths and line numbers for references to that method. `find_dependency` accepts a dependency name and returns files that import it. `component_tree` starts at an entry file and returns a JSON representation of the React component structure.

The component-tree result can include element metadata such as props, an `onClick` value, and a selected data attribute. Its traversal depth is controlled by `maxDepth`, which defaults to 3.

## Setup and configuration

The jsc-typescript-ast-mcp MCP server requires Node.js and Yarn. A basic setup is:

1. Clone the repository.
2. Run `yarn install`.
3. Copy `.env.example` to `.env`.
4. Set `PROJECT_TSCONFIG_PATH` to the target project’s `tsconfig.json`.
5. Build with `yarn build`.
6. Check the server with `yarn test:mcp`.

For Claude Code, build the project and copy or adapt `.mcp.example.json` into the MCP configuration. Enable the configured server in Claude Code, start the client, and use `/mcp` to verify the connection.

## Tools and capabilities

- **`find_reference`**: Finds references to a named method on a named class. Inputs are `filePath`, `className`, and `methodName`; results contain file paths with line numbers.
- **`find_dependency`**: Finds project files that import the supplied `dependencyName`.
- **`component_tree`**: Analyzes React components from an `entryFilePath`. `maxDepth` limits traversal and defaults to 3. An optional `data-id` input selects an attribute to expose as `TreeNode.dataId`.

## Limitations and notes

Analysis depends on the selected TypeScript configuration and the files included by that project. The documented setup requires Node.js and Yarn. The component-tree capability is described for React component structures, while the reference and dependency tools operate on the configured TypeScript codebase. The repository is licensed under MIT.

_Full upstream README: https://allmcps.com/mcp/jsc-typescript-ast-mcp/readme_

