Skip to main content
Glama
MCP Source Tree Server

MCP Source Tree Server

by owayo

Servidor de árbol de origen MCP

Este es un servidor MCP que genera un árbol de archivos bajo un directorio específico. Excluir archivos o directorios específicos según los directorios que comiencen con . o condiciones enumeradas en .gitignore . La integración con Claude le permite ver rápidamente la estructura del proyecto y le ayuda a identificar qué archivos editar.

función

  • Obtiene el árbol de archivos bajo el directorio especificado en formato JSON.

  • Excluir archivos/directorios según las condiciones de .gitignore

  • Representa la estructura del directorio como JSON jerárquico

Related MCP server: MCP Git Explorer

configuración

Prerrequisitos

  • Python 3.10 o posterior

  • ultravioleta

instalar

# uvのインストール
$ curl -LsSf https://astral.sh/uv/install.sh | sh

$ cd /path/to/mcp-src-tree
# ライブラリのインストール
$ uv sync

Claude para configuraciones de escritorio

Agregue lo siguiente a claude_desktop_config.json :

{
    "mcpServers": {
        "src-tree": {
            "command": "uv",
            "args": [
                "--directory",
                "/path/to/mcp-src-tree",  # このプロジェクトディレクトリの絶対パスに書き換えてください
                "run",
                "tree.py"
            ]
        }
    }
}

Ejemplo de uso de Claude

Especifique el directorio raíz un nivel por encima de src. Al tomar .gitignore en consideración, se asume que .gitignore existe directamente bajo el directorio raíz. /Users/xxx/GitHub/xxx/ のソースツリーを確認してくださいy funcionará.

Responde lo siguiente:

はい、ソースツリーを確認させていただきます。
プロジェクトの構造を確認しました。以下のような構成になっています:
src/
└── xxxx/
    ├── __init__.py
    ├── converter.py
    ├── html_converter.py
    ├── image_processor.py
    ├── toc_analyzer.py
    └── utils.py

Esto le permite a Claude ver rápidamente la estructura del proyecto.

Exclusiones de archivos

Directorios que comienzan con . quedan automáticamente excluidos. Los archivos y directorios que coinciden con un patrón en .gitignore se excluyen automáticamente del árbol. Por ejemplo, la siguiente configuración .gitignore es válida:

__pycache__/
node_modules/
*.log

Available Tools

1 tool
get_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

    B3.1/5.0

    Scored across 1 tool

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count2/5

    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.

    Completeness2/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers