Skip to content

Fix: Normalize Unicode in file paths to handle macOS screenshot filenames (ENOENT) #2112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jagansanikommu
Copy link

Description: This PR addresses issue Fixes #1970: macOS screenshot files with non-breaking spaces and special Unicode characters are now properly recognized by all MCP filesystem operations.
Key changes:

Adds a new utility (unicodeNormalize.ts) to normalize filenames (NFC, replace U+00A0 and other Unicode spaces/punctuation).
Applies normalization in all core file operations (move, read, write, edit, create, etc.).
Improves error messages for ENOENT if a Unicode issue is suspected.
Updates documentation with a dedicated Unicode filename handling section.
Adds tests for normalization edge cases.
Commit message: fix(filesystem): normalize Unicode in file paths for macOS screenshot compatibility

Introduce normalizeUnicodePath utility for NFC normalization and Unicode space/punctuation replacement.
Apply normalization in all relevant file system handlers.
Enhance ENOENT error messages to help users identify Unicode filename issues.
Document Unicode quirks in README.
Add tests for normalization logic.

@olaservo olaservo added server-filesystem Reference implementation for the Filesystem MCP server - src/filesystem bug Something isn't working labels Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server-filesystem Reference implementation for the Filesystem MCP server - src/filesystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 MCP Filesystem: macOS Screenshot Files Fail with Unicode Characters (ENOENT Error)
2 participants