The official MCP filesystem server (@modelcontextprotocol/server-filesystem) fails to access directories containing accented characters on macOS (e.g. Drive partagés from Google Drive).
Root cause: macOS stores filenames in Unicode NFD (decomposed) form where é = e + combining accent (U+0301), while user input and the MCP client send paths in NFC (composed) form where é = single codepoint U+00E9. The server compares these byte-different strings and rejects the path as "outside allowed directories".
This affects any macOS path with accented characters (French, German, Spanish, Korean, etc.).
Three surgical changes to normalize all paths to NFC before comparison:
unicode-nfc.ts— New helper module: wrapsString.prototype.normalize('NFC')(native Node.js, zero dependencies)path-utils.ts—normalizePath()now returns NFC-normalized strings (3 return points patched)path-validation.ts—isPathWithinAllowedDirectories()NFC-normalizes both the input path and allowed directories before comparison
- Node.js ≥ 18
- npm
- git
# 1. Download all files from this gist into a folder
mkdir -p ~/claude/mcp-filesystem-nfc-patch
cd ~/claude/mcp-filesystem-nfc-patch
# (download the 4 files here: setup script + 3 .ts files)
# 2. Run the setup script
bash setup-mcp-filesystem-nfc.shThe script will:
- Clone the official MCP servers repo (sparse checkout, only
src/filesystem) - Copy the 3 patched TypeScript files over the originals
- Run
npm installandnpm run build - Verify NFC normalization is present in the compiled output
- Print the Claude Desktop config to use
After the script completes, update your Claude Desktop config (Settings → Developer → Edit Config):
{
"mcpServers": {
"filesystem": {
"command": "node",
"args": [
"/Users/YOUR_USER/claude/mcp-filesystem-patched/src/filesystem/dist/index.js",
"/Users/YOUR_USER/Library/CloudStorage/GoogleDrive-xxx@yyy.com/Drive partagés",
"/Users/YOUR_USER/Desktop"
]
}
}
}Then restart Claude Desktop (Cmd+Q, reopen).
To update to a newer upstream version while keeping the patch:
cd ~/claude/mcp-filesystem-patched
git pull origin main
cd src/filesystem
cp ~/claude/mcp-filesystem-nfc-patch/unicode-nfc.ts .
cp ~/claude/mcp-filesystem-nfc-patch/path-utils.ts .
cp ~/claude/mcp-filesystem-nfc-patch/path-validation.ts .
npm install && npm run buildBased on @modelcontextprotocol/server-filesystem v0.6.3 from modelcontextprotocol/servers.
A PR should be submitted to fix this upstream. The fix is backward-compatible: NFC normalization on already-NFC strings is a no-op.