modelcontextprotocol / modelcontextprotocol/servers
Add depth parameter to directory_tree function in filesystem server
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 90.5k
- Forks
- 11.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 5
Description
Hi,
I’d like to suggest adding a depth parameter to the directory_tree function in the filesystem server.
I’m currently building an AI agent that utilizes the MCP server. When I call directory_tree to list files in a system repository, the returned file structure is too large, making it difficult to include in prompts due to token limitations. A depth limit would help return a more concise, manageable view of the directory structure.
Thanks for considering this enhancement!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the directory_tree function in the filesystem server and read how it currently traverses and returns the repository structure. Determine how a depth parameter should limit the returned tree, then verify that calls with and without the parameter produce appropriately sized results. The issue does not name a file or test to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100