Skip to content

fix(filesystem): handle canonical Windows share paths#4265

Open
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/filesystem-root-allowed-dir-prefix
Open

fix(filesystem): handle canonical Windows share paths#4265
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/filesystem-root-allowed-dir-prefix

Conversation

@he-yufeng

Copy link
Copy Markdown

Summary

  • allow filesystem requests using Windows mapped-drive paths to pass when realpath resolves inside the configured UNC allow-list
  • handle UNC share allow-list entries that already end with a separator without requiring a double separator
  • add Windows regression coverage for existing and new files

Fixes #4129.
Fixes #3756.

To verify

  • npm exec -w src/filesystem -- vitest run tests/path-validation.test.ts
  • npm exec -w src/filesystem -- vitest run tests/lib.test.ts
  • npm run build -w src/filesystem
  • npm test -w src/filesystem
  • git diff --check

@LuuOW LuuOW left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical audit: Verified MCP server implementation for consistency with current SDK patterns.

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

Labels

None yet

Projects

None yet

2 participants