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
- Asecurity-licenseAqualityProvides tools for collecting and documenting code from directories.Last updated -47315MIT License
- Asecurity-licenseAqualityAnalyzes source code dependencies across multiple programming languages in the specified directory to identify file relationships, assisting in dependency management and project structure understanding.Last updated -11MIT License
- Asecurity-licenseAqualityA TypeScript-based server that visualizes project directory structures in Markdown format, automatically documenting file contents with syntax highlighting and supporting customizable exclusion patterns.Last updated -1143
- -security-license-qualityA tool that helps rank codebase files by importance (1-10 scale), track file dependencies, and provide summaries, all accessible through a simple JSON-based interface.