LABSCO SUMMARY
The exclusions are the reason to use it.
A raw recursive listing of a real project is mostly node_modules and build output, and it arrives before the model has read a single line of your code. Reusing .gitignore means the filter is already written and already correct, and stays correct as the project changes.
What it is
A file-tree server for a directory you name. It walks the project and returns the structure as JSON, leaving out the noise that would otherwise fill the context window.
What you get
- The file tree under a directory, returned as hierarchical JSON
- Directories beginning with a dot excluded automatically
- Anything matching the project's
.gitignoreexcluded too — patterns like__pycache__/,node_modules/and*.lognever reach the model
Requirements
The project mcp-src-tree, version 0.1.0, run from a checkout: uv sync to install, then have the client launch tree.py with uv against the project directory. Python 3.10 or above and uv. Point it at the root directory one level above src; .gitignore filtering assumes that file sits in that root.
Setup effort
Build from source — git clone https://github.com/owayo/mcp-src-tree
USE CASES
01
Orienting an assistant in an unfamiliar repository
Ask for the source tree first, so it can pick the files worth opening.
02
Keeping build artefacts out of the context window
Ignored paths never appear in the tree at all, so nothing has to be filtered afterwards.
03
Deciding which file to edit
Read the structure before a change, rather than guessing at a path and having the edit fail.
BEFORE YOU INSTALL
What to know first
Requires
Python 3.10 or later
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
You clone this one yourself.
Server setup
TERMINAL
git clone https://github.com/owayo/mcp-src-tree
cd mcp-src-tree
curl -LsSf https://astral.sh/uv/install.sh | sh
uv syncMCP Clients
Claude Desktop
CLAUDE DESKTOP · JSON
{
"mcpServers": {
"src-tree": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_MCP_SRC_TREE>",
"run",
"tree.py"
]
}
}
}