Skip to content

When using the filesystem MCP server on Windows, the error "Parent directory does not exist" always occurs. I have already found a solution to fix it. #1820

Closed as duplicate

Description

@lzfxp

When using the filesystem MCP server on Windows, the error "Parent directory does not exist" always occurs.

My configuration is correct, but this error always occurs. Later, through debugging, I found that the issue lies in this line of code:

const isParentAllowed = allowedDirectories.some(dir => normalizedParent.startsWith(dir));

The normalizedParent parameter converts my drive letter to uppercase, such as “E:\test”, while the directory I configured is “e:\test”. These two strings will never match. I changed the check to the following code, and it can run successfully:

const isParentAllowed = allowedDirectories.some(dir =>
process.platform === 'win32'
? normalizedParent.toLowerCase().startsWith(dir.toLowerCase())
: normalizedParent.startsWith(dir)

Activity

  1. added
    bug
    on May 17, 2025
  2. Shadowfita commented on Jun 12, 2025

    @Shadowfita

    Same issue here

  3. added
    server-filesystem
    on Jul 28, 2025
  4. domdomegg commented on Aug 9, 2025

    @domdomegg
    Member

    Thanks for reporting this! Going to merge this into #470 for clearer tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugserver-filesystem

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions