Skip to content

fix(filesystem): tolerate Windows realpath ENOENT#3948

Open
krot4u wants to merge 1 commit intomodelcontextprotocol:mainfrom
krot4u:fix/filesystem-windows-realpath-roots
Open

fix(filesystem): tolerate Windows realpath ENOENT#3948
krot4u wants to merge 1 commit intomodelcontextprotocol:mainfrom
krot4u:fix/filesystem-windows-realpath-roots

Conversation

@krot4u
Copy link
Copy Markdown

@krot4u krot4u commented Apr 14, 2026

Summary

  • Fix Windows roots parsing/validation when s.realpath() returns ENOENT for existing paths (e.g. SUBST/mapped drives).
  • In �alidatePath(), fall back to stat() checks when
    ealpath() fails with ENOENT to avoid false Parent directory does not exist.
  • Add/adjust tests to avoid dependence on Windows 8.3 short-path differences and to cover the new fallback behavior.

Motivation

Cursor/VS Code clients may provide roots like ile:///d%3A/.... On some Windows setups, s.realpath() can fail with ENOENT for paths that exist, causing filesystem MCP to drop roots and reject valid operations.

Test plan

pm test in src/filesystem

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant