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 "Install 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 Servershow 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: EliteMCP
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/
*.logMaintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- -license-quality-maintenanceA secure MCP server enabling read-only access and file search capabilities within a specified directory, while respecting .gitignore patterns.
- Flicense-quality-maintenanceAnalyzes 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
- Alicense-qualityDmaintenanceConverts entire codebases into a single, AI-readable Markdown document with structured directory trees and syntax highlighting. It enables AI assistants to analyze complete project contexts for tasks like code reviews, documentation, and refactoring.MIT
- AlicenseAqualityDmaintenanceEnables Claude to explore and analyze remote Git repositories, providing structured file contents and token estimates.4MIT
Related MCP Connectors
AI job search for Claude, ChatGPT, Cursor. 170K+ jobs, 3,800+ companies. OAuth or stdio.
Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.
Generate AGENTS.md, AP2 compliance docs, checkout rules, debug playbook & MCP configs from any repo.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/owayo/mcp-src-tree'
If you have feedback or need assistance with the MCP directory API, please join our Discord server