modelcontextprotocol / modelcontextprotocol/servers

Cross-platform filesystem path configuration for MCP Server Filesystem

Open
#1,725 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

server-filesystem
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:

  1. 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}"
      ]
    }
  }
}
  1. 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;
  1. 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.