Paths Tree Generator
Converts a flat list of filesystem paths into a JSON directory tree.
Paths Tree Generator MCP Server
This repository contains a minimal Model Context Protocol server that exposes one tool – paths_to_tree – which converts a flat list of filesystem paths into a JSON directory tree.
Quick-start
1. Install dependencies
A Python ≥ 3.9 interpreter is required. It's best to work inside a virtual-env:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
2. Run the server
There are two common ways to launch it:
# a) Development mode – auto-reload & web inspector
mcp dev main.py
# b) Plain stdio mode – good for Cursor / Claude Desktop integrations
python main.py
When started with mcp dev the MCP Inspector will open at http://localhost:6274/ and allow you to invoke the tool from the browser.
Tool API
paths_to_tree(paths: list[str]) -> str
Example invocation
[
"config/webpack.config.js",
"components/Modal",
"components/Form",
"components/Table",
"pages/home",
"pages/app",
"pages/help",
"package.json",
"package-lock.json"
]
Response
project-root
├── components
│ ├── Form
│ ├── Modal
│ └── Table
├── config
│ └── webpack.config.js
├── pages
│ ├── app
│ ├── help
│ └── home
├── package-lock.json
└── package.json
Using the server in Cursor or Claude Desktop
Add an entry to your MCP configuration (examples shown for Cursor):
{
"mcpServers": {
"paths-tree": {
"command": "/absolute/path/to/python",
"args": ["/absolute/path/to/main.py"]
}
}
}
Restart your host application and the paths_to_tree tool will be available for use.
Feel free to extend the project with additional tools (e.g. serialisation to Markdown, filtering, etc.) – just decorate functions with @mcp.tool() and they will automatically be exposed through MCP.
Máy chủ liên quan
Filesystem MCP Server
Perform filesystem operations within specified directories.
CData FTP Server
A read-only MCP server for querying live FTP data using the CData JDBC Driver.
MCP File System Server
A server for secure, sandboxed file system operations.
File Convert MCP Server
Convert files between various formats, including images, documents, audio, video, and more.
Obsidian MCP Server - Enhanced
Provides comprehensive access to an Obsidian vault, allowing AI agents to read, write, search, and manage notes via the Local REST API plugin.
IDE MEMORY MCP
IDE Memory MCP gives AI coding agents a persistent memory layer that works across any IDE supporting the Model Context Protocol. Write project context once — the AI remembers it everywhere.
Excel Analyser MCP
Read and analyze Excel (.xlsx) and CSV (.csv) files with scalable, chunked, and column-specific data access, ideal for large datasets.
Music Collection MCP Server
An MCP server for intelligent access to your local music collection, featuring metadata management, band discovery, and advanced querying.
plsreadme
Share markdown files and text as clean, readable web links. Works with Cursor, Claude Desktop, VS Code, Windsurf, and any MCP client.
PDF to PNG
A server that converts PDF files to PNG images. Requires the poppler library to be installed.