Skip to content

MCP Filesystem Server crashes when configured path is unavailable #2815

@ghost

Description

Describe the bug
The MCP Filesystem server crashes immediately after initialization when any configured path in allowed_directories is unavailable (e.g., unmounted external drive, disconnected network share). This makes ALL filesystem access unavailable, even for paths that are accessible.

To Reproduce
Steps to reproduce the behavior:

  1. Configure MCP Filesystem server with multiple paths in allowed_directories, including an external drive path (e.g., /Volumes/External-Drive/Backup)
  2. Unmount or disconnect the external drive
  3. Start Claude Desktop application
  4. Observe that Filesystem MCP server initializes but immediately crashes
  5. Check logs - see "Server transport closed unexpectedly" error

Expected behavior
The server should handle unavailable paths gracefully by either:

Skipping unavailable paths with a warning in logs and continuing with available paths
Showing a non-fatal error notification to the user
Validating path accessibility during initialization and removing inaccessible paths from the working set

The server should remain operational for all accessible paths even if some configured paths are unavailable.

Logs
From ~/Library/Logs/Claude/mcp-server-Filesystem.log:
2025-10-03T13:47:16.290Z [info] [Filesystem] Server transport closed 2025-10-03T13:47:16.290Z [info] [Filesystem] Client transport closed 2025-10-03T13:47:16.290Z [info] [Filesystem] Server transport closed unexpectedly, this is likely due to the process exiting early. If you are developing this MCP server you can add output to stderr (i.e. console.error('...')in JavaScript,print('...', file=sys.stderr) in python) and it will appear in this log. 2025-10-03T13:47:16.290Z [error] [Filesystem] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging)

Configuration file at time of crash (note: /Volumes/External-Drive/Backup was unmounted):
{ "isEnabled": true, "userConfig": { "allowed_directories": [ "/Users/username/Desktop", "/Volumes/System-HD/", "/Volumes/External-Drive/Backup" ] } }

Additional context
Platform: macOS
Workaround: Manually editing config file to remove unavailable paths resolves the issue, but this is not user-friendly for common scenarios (laptop users with external drives, network shares, etc.)
Impact: This affects users who frequently connect/disconnect external storage or work across different locations
AI Support Response: Received automated response suggesting environment variables and startup scripts, but these don't address the core issue of graceful failure handling

Other MCP servers (Control Chrome, Control your Mac) handle initialization correctly and don't crash when encountering issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions