-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Filesystem MCP server crashes silently on directory paths containing leading ~ (tilde) character
Environment:
- Claude Desktop: Latest (as of February 26, 2026)
- macOS: Sequoia (Apple Silicon)
- Node.js: v25.4.0 (Homebrew)
- MCP Filesystem Extension: Installed via Claude Desktop extensions marketplace
Description:
The Filesystem MCP server crashes silently when any of the configured allowed directories contains a leading tilde (~) as a literal character in the folder name (e.g., /Volumes/Drive/Projects/~MyFolder). This is a valid and common naming convention used to force important folders to sort to the top of a directory listing.
The server starts successfully, receives the initialize handshake from the client, then immediately exits with no error message or stack trace. The failure is silent — nothing in the logs indicates what went wrong.
Log snippet showing failure pattern:
2026-02-26T15:12:22.731Z [Filesystem] [info] Server started and connected successfully
2026-02-26T15:12:22.867Z [Filesystem] [info] Message from client: {"method":"initialize","params":{"protocolVersion":"2025-11-25"...}
2026-02-26T15:12:22.877Z [Filesystem] [info] Server transport closed unexpectedly, this is likely due to the process exiting early.
2026-02-26T15:12:22.877Z [Filesystem] [error] Server disconnected.
Steps to reproduce:
- Install the Filesystem MCP extension via Claude Desktop
- Add an allowed directory whose name begins with ~ (e.g., /Volumes/Drive/Projects/~MyFolder)
- Relaunch Claude Desktop
- Observe server fails with "Server disconnected" and no descriptive error
Verification:
Running the server manually works without issue:
node "/Users/<user>/Library/Application Support/Claude/Claude Extensions/ant.dir.ant.anthropic.filesystem/server/index.js" "/Volumes/Drive/Projects/~MyFolder"
Output: Secure MCP Filesystem Server running on stdio
Removing the ~ prefix from the directory name resolves the issue immediately, confirming the tilde character is the root cause.
Expected behavior:
The server should either handle ~ as a literal character in directory paths, or throw a descriptive error identifying the problematic path rather than crashing silently.
Impact:
Using ~ as a prefix to sort important folders to the top of a directory listing is a common convention. Any user employing this pattern will hit this bug with no indication of what went wrong, requiring significant debugging effort to isolate.