modelcontextprotocol / modelcontextprotocol/servers

File system tools unable to traverse symlinked directories beyond top level

Open
#734 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug server-filesystem
Dominant language
TypeScript
Stars
90.5k
Forks
11.7k
Avg merge
2d 2h
Merged PRs (30d)
5

Description

Describe the bug
The file system tools can't access child directories within a symlinked directory. While the tools can successfully list the contents of the symlinked directory itself, any attempt to access subdirectories results in an error claiming the parent directory doesn't exist.

To Reproduce
Steps to reproduce the behavior:

  • Create a symbolic link to a directory (e.g., MCP_Servers in MCP_Root)
  • Use file system tools to access the symlinked directory (succeeds)
  • Attempt to access any subdirectory within the symlinked directory (fails)
  • Error message states that the parent directory doesn't exist

Expected behavior
The file system tools should be able to traverse the entire directory structure through the symlink, not just the top level.

Logs
`> list_directory("F:/MCP_Root/MCP_Servers")
[DIR] .git
[FILE] .gitattributes
[DIR] .github
[FILE] .gitignore
[FILE] .npmrc
[FILE] CODE_OF_CONDUCT.md
[FILE] CONTRIBUTING.md
[FILE] LICENSE
[DIR] node_modules
[FILE] package-lock.json
[FILE] package.json
[FILE] README.md
[DIR] scripts
[FILE] SECURITY.md
[DIR] src
[FILE] tsconfig.json

list_directory("F:/MCP_Root/MCP_Servers/src")
Error: Parent directory does not exist: F:\MCP_Root\MCP_Servers

read_file("F:/MCP_Root/MCP_Servers/src/filesystem/README.md")
Error: Parent directory does not exist: F:\MCP_Root\MCP_Servers\src\filesystem`

Additional context
This issue prevents programmatic access to configuration details and documentation within the server implementation directories. The symlink appears to be valid as accessing the top-level directory works, but the link cannot be followed deeper into the structure.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with a directory symlink and the file system tools, then trace the parent-directory validation used for nested paths. Compare top-level listing with nested list_directory and read_file calls. Done means symlinked directories can be traversed at arbitrary depth without the parent-directory error, with regression coverage for nested access.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.