MCP Source Tree Server
指定されたディレクトリ配下のファイルツリーを生成するMCPサーバーです。
.
で始まるディレクトリや.gitignore
に記載された条件に従って、特定のファイルやディレクトリを除外します。
Claudeに組み込むことで、Claudeがプロジェクトの構造を素早く確認でき、Claudeが編集すべきファイルを特定するのに役立ちます。
機能
- 指定されたディレクトリ配下のファイルツリーをJSON形式で取得
.gitignore
の条件に従ってファイル/ディレクトリを除外- ディレクトリ構造を階層的なJSONで表現
セットアップ
必要条件
- Python 3.10以上
- uv
インストール
Claude for Desktopでの設定
claude_desktop_config.json
に以下の設定を追加してください:
Claudeでの使用例
指示するのはsrcの一つ上のルートディレクトリを指定してください。
.gitignore
を考慮する場合、ルートディレクトリ直下に .gitignore
が存在することが前提です。
/Users/xxx/GitHub/xxx/ のソースツリーを確認してください
のように指示すると動作します
以下のように応答します
これにより、Claudeが素早くプロジェクトの構造を確認できます。
ファイル除外
.
で始まるディレクトリは自動的に除外されます。
.gitignore
に記載されているパターンに合致するファイルやディレクトリは、ツリーから自動的に除外されます。
例えば、以下のような .gitignore
の設定が有効です:
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
Generates a JSON file tree from a specified directory's 'src' folder, adhering to '.gitignore' rules, allowing for quick project structure review in Claude.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityProvides tools for collecting and documenting code from directories.Last updated -48112TypeScriptMIT License
- AsecurityAlicenseAqualityFacilitates the analysis of Figma file structures by extracting node hierarchies, accessible via REST API or MCP protocol.Last updated -12TypeScriptMIT License
- AsecurityAlicenseAqualityA Node.js server that allows browsing Git repositories through MCP, providing tools to view directory structures and read important files from repositories.Last updated -2JavaScriptMIT License
- AsecurityAlicenseAqualityProvides deep git file-level forensics tools to analyze detailed file histories, changes, and patterns within git repositories, focusing on individual file analysis rather than repository-wide operations.Last updated -4JavaScriptApache 2.0