MCP Source Tree Server
local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Respects .gitignore patterns to exclude files and directories according to Git's ignore rules when generating the file tree.
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
の設定が有効です:
You must be authenticated.
Generates a JSON file tree from a specified directory's 'src' folder, adhering to '.gitignore' rules, allowing for quick project structure review in Claude.