TypeScript AST MCP Server
TypeScript AST MCP Server
TypeScript AST(抽象構文木)解析機能を提供するModel Context Protocol(MCP)サーバーです。このサーバーは、ts-morphライブラリを使用して、クラスやメソッドの参照の検索、コンポーネントツリーの解析、TypeScriptコードの依存関係の検出を行うことができます。
機能
MCPサーバー: AIアシスタントとの統合のためのModel Context Protocolを実装
TypeScript解析: ts-morphを使用した強力なTypeScript ASTの解析と分析
参照検索: コードベース内の指定されたクラスメソッドへのすべての参照を検索
依存関係の検出:
find_dependencyツールを使用して、指定されたライブラリをインポートするすべてのファイルを一覧表示コンポーネントツリー解析:
component_treeツールを使用して、コードベース内のReactコンポーネント構造を解析これらのツールはMCPサーバーの一部であり、Claude Codeやその他のMCPクライアントから呼び出すことができます。
Related MCP server: agent-workspace-mcp
前提条件
Node.js(プロジェクトと互換性のあるバージョン)
Yarnパッケージマネージャー
セットアップ
リポジトリをクローンします
依存関係をインストールします:
yarn installサンプル設定ファイルをコピーします:
cp .env.example .envプロジェクトのtsconfigパスを
.envに更新します:PROJECT_TSCONFIG_PATH=/path/to/your/project/tsconfig.json
実行方法
プロジェクトをビルド:
yarn buildMCPサーバーをテスト:
yarn test:mcpこれにより、MCP互換クライアントが接続できるMCPサーバーが起動します。
Claude Codeへのインストール
Claude CodeでこのMCPサーバーを使用するには:
サーバーをビルド:
yarn buildClaude Codeを設定:
.mcp.example.jsonを.mcp.jsonにコピーします(または、既存の.mcp.jsonをMCP設定の内容で更新します).claude/settings.local.jsonを編集し、MCPセクションを追加します(すでに一部のMCPが設定されている場合は、必要なサブセットのみ)
“enableAllProjectMcpServers”: true,
“enabledMcpjsonServers”: [
“typescript-ast”
]Claude Codeを起動します
/mcpコマンドを入力し、MCPが接続されていることを確認します
開発
コードの更新:
src/内のTypeScriptソースファイルに変更を加えますプロジェクトをビルド:
yarn build変更をテスト:
yarn test:mcp
環境変数
サーバーは以下の環境変数を使用します:
PROJECT_TSCONFIG_PATH: プロジェクト解析に使用するtsconfig.jsonファイルへのパス(デフォルトは'tsconfig.json')
設定ファイルの例
.env.example: 環境変数のサンプルファイル.mcp.example.json: MCP設定のサンプルファイル(該当する場合)
ツールの説明
サーバーは3つのツールを提供します:
1. find_reference
コードベース内の指定されたクラスメソッドへのすべての参照を検索します。
入力:
filePath: ファイルへのパスclassName: クラス名methodName: メソッド名
出力: メソッドが参照されているファイルパスと行番号のリスト
2. find_dependency
指定されたライブラリをインポートするすべてのファイルを一覧表示します。
入力:
dependencyName: 検索する依存関係の名前
出力: 指定された依存関係をインポートするファイルパスのリスト
3. component_tree
コードベース内のReactコンポーネント構造を解析します。
入力:
entryFilePath: エントリファイルへのパスmaxDepth: コンポーネントツリーの最大深度(デフォルト: 3)data-id(オプション):TreeNode.dataIdに取り込む属性名(例:data-attribute-id)
出力: コンポーネントツリー構造のJSON表現。
props、dataId、onClickなどのオプションの要素メタデータを含む
ライセンス
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Stateless TS/JS compiler facts for agents: references, imports, impact. No repo index or OAuth.
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
Coding agents in multi-service codebases routinely rebuild existing helpers, trust stale type definitions, and modify API contracts without knowing who consumes them. Carrick solves this by indexing your entire TypeScript ecosystem across service and repository boundaries. By integrating deeply with the TypeScript compiler, Carrick traces every route, type, and cross-service call while recording function behaviour so agents search by intent rather than name. Delivered via MCP for AI agents and LSP for IDEs, Carrick ensures models see existing endpoints and utilities before generating new code. The scanner is source-available and runs from your CLI or CI pipeline.
Related MCP Servers
- AlicenseBqualityDmaintenanceTypeScript-based MCP server designed to enhance code editing experiences by providing features such as hover information, code completion, and diagnostics.328 npm26MIT
- 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.715 npm1MIT
- AlicenseNot gradedqualityCmaintenanceAST-aware TypeScript/JavaScript codebase exploration for AI agents, providing high-precision symbol resolution, reference finding, and structural analysis via MCP tools.228 npmMIT
- FlicenseBqualityDmaintenanceMCP server for TypeScript type resolution and dependency graph analysis using ts-morph and madge.81-