-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Description
Enhancement Request: Graceful handling of temporarily unavailable network paths
Summary
The Filesystem MCP Server currently crashes on startup if any configured path is temporarily unavailable (e.g., network drives, NAS systems). This prevents using the server in environments where some paths may be intermittently available.
Current Behavior
- Server performs
fs.stat()
on all configured paths during startup - If ANY path is unreachable, server terminates with
process.exit(1)
- This makes the entire filesystem server unusable when network paths are offline
Expected Behavior
The server should:
- Start successfully even if some network paths are temporarily unavailable
- Log warnings for unreachable paths instead of crashing
- Gracefully handle operations on unavailable paths at runtime with appropriate error messages
- Optionally retry path validation periodically or on-demand
Use Case
Many users have configurations mixing local paths with network storage (NAS, SMB shares, etc.) that may not be available 24/7:
- Home NAS systems that power down overnight
- VPN-connected network drives
- Intermittent cloud storage mounts
Reproduction
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"C:\\Users\\username\\Documents",
"\\\\nas.local\\shared\\documents" // <- NAS is offline
]
}
}
}
Current result: Server fails to start completely
Expected result: Server starts, local paths work, NAS operations fail gracefully
Proposed Solutions
Option 1: Command-line flag (recommended)
npx @modelcontextprotocol/server-filesystem --ignore-missing-paths C:\local \\nas\share
Option 2: Path-specific configuration
{
"required": ["C:\\Users\\username\\Documents"],
"optional": ["\\\\nas.local\\shared\\documents"]
}
Option 3: Runtime validation only
Skip startup validation entirely, handle path availability at operation time.
Impact
This enhancement would:
- ✅ Improve reliability in mixed local/network environments
- ✅ Reduce configuration management complexity
- ✅ Allow for more flexible deployment scenarios
- ✅ Maintain backward compatibility
Environment
- OS: Windows 11
- Package: @modelcontextprotocol/server-filesystem (latest)
- Client: Claude Desktop
Related Issues
Similar issues suggest this is a common pain point:
- Filesystem MCP Server (Windows/NPX): Flawed path validation ("outside allowed") and case sensitivity with initial arg #1838 (path validation issues on Windows)
- Could not attach to MCP server filesystem #267 (server connection failures)
- How to configure windows filesystem? #75 (Windows filesystem configuration issues)
Additional Context
The current "fail-fast" approach makes sense for critical paths but is too rigid for optional network resources. A more resilient approach would significantly improve the user experience for mixed-environment setups.
Logs
From C:\Users\Christoph\AppData\Roaming\Claude\logs\mcp-server-filesystem.log
:
Error accessing directory \\ds418play\Daten\Gesundheits- und Krankenpfleger\Arbeitsanweisungen: Error: UNKNOWN: unknown error, stat '\\ds418play\Daten\Gesundheits- und Krankenpfleger\Arbeitsanweisungen'
at async Object.stat (node:internal/fs/promises:1037:18)
at async file:///C:/Users/Christoph/AppData/Local/npm-cache/_npx/a3241bba59c344f5/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js:53:23
at async Promise.all (index 5)
at async file:///C:/Users/Christoph/AppData/Local/npm-cache/_npx/a3241bba59c344f5/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js:51:1 {
errno: -4094,
code: 'UNKNOWN',
syscall: 'stat',
path: '\\\\ds418play\\Daten\\Gesundheits- und Krankenpfleger\\Arbeitsanweisungen'
}