
MCP Source Tree Server
Generates a JSON file tree from a specified directory's 'src' folder, adhering to '.gitignore' rules, allowing for quick project structure review in Claude.
owayo
Tools
get_src_tree
Generate a file tree for the specified directory, filtering files based on .gitignore. Traverses the filesystem and generates a JSON-formatted tree structure that preserves hierarchy.
README
MCP Source Tree Server
指定されたディレクトリ配下のファイルツリーを生成するMCPサーバーです。
.
で始まるディレクトリや.gitignore
に記載された条件に従って、特定のファイルやディレクトリを除外します。
Claudeに組み込むことで、Claudeがプロジェクトの構造を素早く確認でき、Claudeが編集すべきファイルを特定するのに役立ちます。
<a href="https://glama.ai/mcp/servers/1igr60piqh"><img width="380" height="200" src="https://glama.ai/mcp/servers/1igr60piqh/badge" alt="Source Tree Server MCP server" /></a>
機能
- 指定されたディレクトリ配下のファイルツリーをJSON形式で取得
.gitignore
の条件に従ってファイル/ディレクトリを除外- ディレクトリ構造を階層的なJSONで表現
セットアップ
必要条件
- Python 3.10以上
- uv
インストール
# uvのインストール
$ curl -LsSf https://astral.sh/uv/install.sh | sh
$ cd /path/to/mcp-src-tree
# ライブラリのインストール
$ uv sync
Claude for Desktopでの設定
claude_desktop_config.json
に以下の設定を追加してください:
{
"mcpServers": {
"src-tree": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-src-tree", # このプロジェクトディレクトリの絶対パスに書き換えてください
"run",
"tree.py"
]
}
}
}
Claudeでの使用例
指示するのはsrcの一つ上のルートディレクトリを指定してください。
.gitignore
を考慮する場合、ルートディレクトリ直下に .gitignore
が存在することが前提です。
/Users/xxx/GitHub/xxx/ のソースツリーを確認してください
のように指示すると動作します
以下のように応答します
はい、ソースツリーを確認させていただきます。
プロジェクトの構造を確認しました。以下のような構成になっています:
src/
└── xxxx/
├── __init__.py
├── converter.py
├── html_converter.py
├── image_processor.py
├── toc_analyzer.py
└── utils.py
これにより、Claudeが素早くプロジェクトの構造を確認できます。
ファイル除外
.
で始まるディレクトリは自動的に除外されます。
.gitignore
に記載されているパターンに合致するファイルやディレクトリは、ツリーから自動的に除外されます。
例えば、以下のような .gitignore
の設定が有効です:
__pycache__/
node_modules/
*.log
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Excel MCP Server
A Model Context Protocol server that enables AI assistants to read from and write to Microsoft Excel files, supporting formats like xlsx, xlsm, xltx, and xltm.
Playwright MCP Server
Provides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Apple MCP Server
Enables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.
Gitingest-MCP
An MCP server for gitingest. It allows MCP clients like Claude Desktop, Cursor, Cline etc to quickly extract information about Github repositories including repository summaries, project directory structure, file contents, etc