Home / MCP / MCP WSL Exec Server
Provides read-only WSL context and safe command execution for Windows users running Claude Desktop.
Configuration
View docs{
"mcpServers": {
"mcp_wsl_exec": {
"command": "npx",
"args": [
"-y",
"mcp-wsl-exec"
]
}
}
}This MCP server lets you securely run commands in your Windows Subsystem for Linux (WSL) from Claude Desktop on Windows, while also gathering context about your WSL environment. It supports read-only information queries and controlled, safe command execution with built-in protections.
You interact with the MCP server through your MCP client. Use the information gathering tools to inspect your WSL environment without making changes, and use the command execution tool to run commands in WSL with safety checks. For dangerous operations, the server will require explicit confirmation before proceeding.
Prerequisites: you need Node.js and npm installed on your system. You will also use your MCP client to connect to the server.
Install the project dependencies and build the server locally, then run in development mode.
Install dependencies using pnpm (the project commonly uses pnpm for development):
pnpm installBuild the project:
pnpm buildRun in development mode:
pnpm devConfigure your MCP client to connect to this server using the provided MCP configuration examples.
Configuration blocks shown here are used by your MCP client to connect to the server. Use these exact snippets in your client configuration.
{
"mcpServers": {
"mcp-wsl-exec": {
"command": "npx",
"args": ["-y", "mcp-wsl-exec"]
}
}
}{
"mcpServers": {
"mcp-wsl-exec": {
"command": "npx",
"args": ["-y", "mcp-wsl-exec"]
}
}
}The server provides built-in safety features for command execution, including detection of dangerous commands, a command confirmation system, path traversal prevention, and command sanitization. Commands can specify a working directory and a timeout to prevent runaway processes. Shell injection is prevented through input sanitization and careful handling of user-provided data.
If you encounter connection issues, verify that your MCP client is configured with the correct server name and that the command and arguments match the server’s supported configuration. Ensure Node.js and npm are installed, and that you have run the build steps before starting in development mode.
Retrieves OS version, kernel, hostname, and other system details.
Returns directory contents and file information for a given path.
Provides disk space usage for specified paths or all filesystems.
Lists environment variables, with optional filtering.
Reports currently running processes, with optional name filtering.
Executes a command in WSL with safety checks and optional timeout, requiring confirmation for dangerous commands.
Confirms execution of a dangerous command that was flagged by safety checks.