MCP Source Tree Server
The MCP Source Tree Server generates a hierarchical JSON representation of a directory's file tree while applying intelligent filtering:
Generate File Tree: Creates a JSON-formatted structure of a specified directory
Filter with
.gitignore: Excludes files and directories based on.gitignorerulesExclude Hidden Items: Automatically ignores directories and files starting with
.(e.g.,.git/)Preserve Hierarchy: Maintains the original directory structure in the output
Respects .gitignore patterns to exclude files and directories according to Git's ignore rules when generating the file tree.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Source Tree Server show me the source tree for my project at /Users/alice/projects/web-app"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Source Tree Server
It is an MCP server that generates a file tree under a specified directory. It excludes certain files and directories, such as directories starting with . or conditions in .gitignore . By incorporating it into Claude, it helps Claude to quickly see the structure of the project and identify the files that Claude should edit.
function
Gets the file tree under the specified directory in JSON format.
Exclude files/directories according to
.gitignoreconditionsRepresents the directory structure as hierarchical JSON
Related MCP server: MCP Git Explorer
set up
Prerequisites
Python 3.10 or later
uv
install
# uvのインストール
$ curl -LsSf https://astral.sh/uv/install.sh | sh
$ cd /path/to/mcp-src-tree
# ライブラリのインストール
$ uv syncClaude for Desktop Settings
Add the following to claude_desktop_config.json :
{
"mcpServers": {
"src-tree": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-src-tree", # このプロジェクトディレクトリの絶対パスに書き換えてください
"run",
"tree.py"
]
}
}
}Claude usage example
Please specify the root directory one level above src. When considering .gitignore , it is assumed that .gitignore exists directly under the root directory. It will work if you specify something like /Users/xxx/GitHub/xxx/ のソースツリーを確認してください
It responds as follows:
はい、ソースツリーを確認させていただきます。
プロジェクトの構造を確認しました。以下のような構成になっています:
src/
└── xxxx/
├── __init__.py
├── converter.py
├── html_converter.py
├── image_processor.py
├── toc_analyzer.py
└── utils.pyThis allows Claude to quickly see the project structure.
File Exclusions
Directories beginning with . are automatically excluded. Files and directories that match a pattern in .gitignore are automatically excluded from the tree. For example, the following .gitignore configuration is valid:
__pycache__/
node_modules/
*.logAvailable Tools
1 toolget_src_treeC
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.
Inputs: directory (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined and distinct by default.
A single tool inherently has perfect naming consistency, as there are no other tools to compare against. The name 'get_src_tree' follows a clear verb_noun pattern.
A single tool is too few for most practical server purposes, as it severely limits functionality and flexibility. This server appears to offer only basic directory tree generation, which feels thin and under-scoped.
The server's domain seems to be file system or source tree operations, but with only one tool for generating a tree, there are significant gaps. Missing operations might include filtering by other criteria, updating trees, or handling file contents, making the surface incomplete for typical agent workflows.
Maintenance
Related MCP Connectors
Generate and validate a .specs/ bundle for your repo, then hand it to your AI coding agent
Compare two JSON files deeply, ignoring order, to surface every difference. Get a clear, structure…
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
Generate SBOMs, scan vulnerabilities, and analyze dependencies from local projects or Git repos.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceAnalyzes directory structures with .gitignore awareness and executes Python code in secure sandboxed environments. Combines intelligent codebase analysis with safe code execution for development workflows.1-
- AlicenseAqualityDmaintenanceEnables Claude to explore and analyze remote Git repositories, providing structured file contents and token estimates.4MIT
- FlicenseAqualityDmaintenanceEnables natural language code search across multiple local Git repositories, allowing users to register projects, search for code, and explore file structures through Claude.6-
- FlicenseNot gradedqualityAmaintenanceEnables MCP clients such as Claude Desktop, Cline, and Cursor to quickly extract GitHub repository summaries, project directory structures, and file contents.-