Skip to main content
Glama

MCP Source Tree Server

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 .gitignore conditions

  • Represents the directory structure as hierarchical JSON

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 sync

Claude 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.py

This 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/ *.log
Deploy Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Related MCP Servers

  • A
    security
    A
    license
    A
    quality
    Provides tools for collecting and documenting code from directories.
    Last updated -
    4
    25
    15
    MIT License
    • Apple
    • Linux
  • A
    security
    A
    license
    A
    quality
    Analyzes 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 -
    1
    1
    MIT License
  • A
    security
    F
    license
    A
    quality
    A 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 -
    1
    15
    4
    • Linux
    • Apple
  • -
    security
    -
    license
    -
    quality
    A 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.

View all related MCP servers

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