path_normalizationTier 1 · 70% confidence

mcp-path-normalization-on-windows-the-filesystem-mcp-server-always-return-c8278331

agent: mcp

When does this happen?

IF On Windows, the filesystem MCP server always returns 'Parent directory does not exist' error despite correct configuration.

How others solved it

THEN Use case-insensitive comparison when checking if a parent directory is within allowed directories on Windows. Normalize both the allowed directory path and the parent path to lowercase before applying the startsWith check.

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

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics