WSL Filesystem MCP server

Provides a bridge between Windows and Linux environments by enabling access to WSL filesystem operations, allowing seamless reading, writing, editing, and management of files within WSL distributions directly from Windows.
Back to servers
Provider
Web-C
Release date
Apr 20, 2025
Language
TypeScript
Package
Stats
53 downloads
1 star

The Model Context Protocol (MCP) server for WSL provides a specialized implementation that leverages native Linux commands inside Windows Subsystem for Linux, offering significantly faster file operations compared to the standard filesystem MCP server, especially for large directory trees and search operations.

Installation Requirements

Installing Node.js on Windows

# Download and run the installer from nodejs.org
# Then verify installation with:
node --version
npm --version

Setup and Configuration

Building from Source

npm install
npm run build

Running the Server

Basic usage format:

node dist/index.js [--distro=distribution_name] <allowed_directory> [additional_directories...]

Examples

To access Ubuntu-20.04 distribution:

node dist/index.js --distro=Ubuntu-20.04 /home/user/documents

To use default distribution:

node dist/index.js /home/user/documents

Integration with Claude Desktop

Add one of these configurations to your claude_desktop_config.json:

Using a specific WSL distribution:

{
  "mcpServers": {
    "wsl-filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-wsl-filesystem",
        "--distro=Ubuntu-20.04",
        "/home/user/documents"
      ]
    }
  }
}

Using the default WSL distribution:

{
  "mcpServers": {
    "wsl-filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-wsl-filesystem",
        "/home/user/documents"
      ]
    }
  }
}

Available Features

File Operations

  • Read and write files in WSL from Windows
  • Create, list, and delete directories in WSL
  • Move files and directories within WSL filesystem
  • Search for files within the WSL environment
  • Retrieve file metadata from the WSL filesystem

Supported Tools

  • read_file: Reads a file's contents as UTF-8 text
  • read_multiple_files: Reads multiple files simultaneously
  • write_file: Creates or overwrites files in WSL
  • edit_file: Performs selective edits with pattern matching and formatting
  • create_directory: Creates or ensures a directory exists
  • list_directory: Shows directory contents with type indicators
  • directory_tree: Generates a recursive JSON tree view
  • move_file: Moves or renames files and directories
  • search_files: Recursively searches by filename pattern
  • get_file_info: Retrieves detailed file metadata
  • list_allowed_directories: Shows all accessible directories
  • list_wsl_distributions: Displays available WSL distributions

Security Note

The server only allows operations within directories explicitly specified via the args parameter in the configuration.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later