Skip to content

Filesystem server fails with directory paths containing spaces #2437

@DesignerFatih

Description

@DesignerFatih

Describe the bug
MCP filesystem server fails to properly handle directory paths containing spaces when specified in claude_desktop_config.json.

To Reproduce
Steps to reproduce the behavior:

  1. Configure Claude Desktop with the following claude_desktop_config.json:
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "D:\\FACE",
        "D:\\WORKING\\00_PROJECT",
        "D:\\DEV DB"
      ]
    }
  }
}

Restart Claude Desktop
Try to access files in the D:\\DEV DB directory
Only the first two directories (without spaces) are accessible

Expected behavior
All three directories should be accessible via MCP, including the one with spaces (D:\\DEV DB).
Logs
The filesystem server starts successfully but the directory with spaces is not recognized as an allowed directory.
Additional context

OS: Windows 11 Turkish
Node JS v22.17.1
Claude 0.12.55 (d55c63) 2025-07-25T17:43:32.000Z
Workarounds attempted:

Tried wrapping path in double quotes: "\"D:\\DEV DB\""
Tried single quotes: "'D:\\DEV DB'"
Both approaches failed


The issue appears to be in argument parsing where spaces in paths are not properly handled
This affects Windows users more commonly due to default folder naming conventions (like "Program Files", "Documents and Settings", etc.)

Edit:

Further testing with various new and existing directory names confirmed that this issue only occurs with paths containing spaces. All other non-space-containing paths are processed correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingserver-filesystemReference implementation for the Filesystem MCP server - src/filesystem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions