modelcontextprotocol / modelcontextprotocol/servers

Filesystem MCP server crashes silently on paths containing ~ (tilde) character

Open
#3,412 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
90.5k
Forks
11.7k
Avg merge
2d 2h
Merged PRs (30d)
5

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:

  1. Install the Filesystem MCP extension via Claude Desktop
  2. Add an allowed directory whose name begins with ~ (e.g., /Volumes/Drive/Projects/~MyFolder)
  3. Relaunch Claude Desktop
  4. 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running server/index.js with the reproduced path and compare its behavior with the manual command shown in the issue. Trace the initialization path for the allowed directory, then add handling or an error for a literal leading tilde; done means the server remains connected or reports the problematic path instead of exiting silently.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.