modelcontextprotocol / modelcontextprotocol/servers
Cross-platform filesystem path configuration for MCP Server Filesystem
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 90.5k
- Forks
- 11.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 5
Description
Problem
When using the MCP Server Filesystem on both macOS and Windows platforms, the settings synchronization mechanism in VS Code causes issues with filesystem paths. Every time settings are synchronized, the path configured for one platform overwrites the other, causing the MCP filesystem server to stop working on the other platform.
Background
In the current implementation, filesystem paths are directly configured in the VS Code settings.json file like this:
"mcp": {
"servers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"${input:file_system_path}" // Or hardcoded path like "C:/Projects"
]
}
},
"inputs": [
{
"id": "file_system_path",
"type": "promptString",
"description": "File System Path"
}
]
}
The issue occurs because Windows paths (e.g., "C:\Projects") and macOS paths (e.g., "/Users/username/Projects") are incompatible, and when settings sync happens, one overwrites the other.
Proposed Solution
Implement a platform-specific configuration option for filesystem paths in the MCP Server Filesystem. Some options:
- Platform-specific inputs: Allow different input variables for different platforms:
"mcp": {
"inputs": [
{
"id": "file_system_path_windows",
"type": "promptString",
"description": "File System Path (Windows)"
},
{
"id": "file_system_path_macos",
"type": "promptString",
"description": "File System Path (macOS)"
}
],
"servers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"${os:windows?input:file_system_path_windows:input:file_system_path_macos}"
]
}
}
}
- Automatic platform detection: Modify the filesystem server to automatically handle platform-specific paths:
// In server code
const platformPath = os.platform() === 'win32'
? process.env.WINDOWS_PATH
: process.env.MACOS_PATH;
- VS Code conditional settings: Support a conditional syntax or settings overrides based on platform.
Benefits
- Users can maintain a single synchronized settings.json that works on all platforms
- No more broken MCP filesystem server on platform switching
- Smoother cross-platform development experience
Affected Components
- MCP Server Filesystem
- VS Code settings handling
Would appreciate if this could be considered for an upcoming release. This would greatly improve the experience for developers working across multiple platforms.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the MCP Server Filesystem entry point and the VS Code settings handling described in the issue. Compare the proposed platform-specific inputs, automatic detection, and conditional settings approaches before choosing a design. Done means one synchronized settings.json works with distinct Windows and macOS filesystem paths without breaking the server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100