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 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