WSL Filesystem Access
STDIONode.js server for filesystem operations in Windows Subsystem for Linux.
Node.js server for filesystem operations in Windows Subsystem for Linux.
⚠️ IMPORTANT INFORMATION:
The original Filesystem MCP Server can already access WSL files by simply using the network path\\wsl.localhost\DistributionName
as a parameter in the configuration.
Example:{ "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "\\\\wsl.localhost\\Debian", "C:\\path\\to\\other\\allowed\\dir" ] } } }
However, this project offers an alternative implementation specifically optimized for WSL Linux distributions.
While the official server works by recursively walking directories using Node.js’s
fs
module, this implementation leverages native Linux commands inside WSL (such asfind
,grep
, etc.), making file listing and content search operations significantly faster.This can be especially useful when dealing with large directory trees or when search performance is critical.
So while the native network path may be simpler for many use cases, this project remains a valuable solution for WSL users looking for better performance or more custom control over the indexing and searching logic.
Node.js server implementing the Model Context Protocol (MCP), specifically designed for filesystem operations in Windows Subsystem for Linux (WSL).
This project is a fork of the original Filesystem MCP Server but completely reimagined for WSL environments.
Unlike the original project, which handles generic file operations, this version focuses exclusively on seamless interaction between Windows and Linux distributions under WSL.
Both projects are compatible and can run in parallel on the same system.
Note: The server only allows operations within directories specified via args
.
wsl -d <distrib>
: Command for operations on WSL distributionsread_file
path
(string)read_multiple_files
paths
(string[])write_file
path
(string)content
(string)edit_file
path
(string)edits
(array of { oldText, newText }
)dryRun
(boolean, optional)create_directory
path
(string)list_directory
[FILE]
or [DIR]
prefixespath
(string)directory_tree
path
(string)move_file
source
(string)destination
(string)search_files
path
(string)pattern
(string)excludePatterns
(string[], optional)get_file_info
path
(string)list_allowed_directories
list_wsl_distributions
For Claude Desktop users:
No additional installation required — just configure your claude_desktop_config.json
.
For development:
node --version npm --version
Before running the server, you need to build the TypeScript project:
npm install npm run build
Run the server by specifying which WSL distribution to use (optional) and which directories to expose:
node dist/index.js [--distro=distribution_name] <allowed_directory> [additional_directories...]
If no distribution is specified, the default WSL distribution will be used.
Access Ubuntu-20.04 distribution:
node dist/index.js --distro=Ubuntu-20.04 /home/user/documents
Use default distribution:
node dist/index.js /home/user/documents
Add this to your claude_desktop_config.json
:
{ "mcpServers": { "wsl-filesystem": { "command": "npx", "args": [ "-y", "mcp-server-wsl-filesystem", "--distro=Ubuntu-20.04", "/home/user/documents" ] } } }
{ "mcpServers": { "wsl-filesystem": { "command": "npx", "args": [ "-y", "mcp-server-wsl-filesystem", "/home/user/documents" ] } } }
In the second example, the system will use your default WSL distribution without you needing to specify it.
This fork adapts the original Filesystem MCP Server to work with WSL by:
This project is a fork of the original Filesystem MCP Server created by the Model Context Protocol team.
This MCP server for WSL is licensed under the MIT License, following the original project's license. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the original project repository.