mcp wsl exec
A secure MCP server for Windows Subsystem for Linux environments, facilitating safe command execution with extensive validation and protection against vulnerabilities like shell injection and dangerous commands.
A secure MCP server for Windows Subsystem for Linux environments, facilitating safe command execution with extensive validation and protection against vulnerabilities like shell injection and dangerous commands.
A Model Context Protocol (MCP) server for executing commands in Windows Subsystem for Linux (WSL) environments. This server provides secure command execution with built-in safety features and validation.
This server requires configuration through your MCP client. Here are examples for different environments:
Add this to your Cline MCP settings:
{
"mcpServers": {
"mcp-wsl-exec": {
"command": "npx",
"args": ["-y", "mcp-wsl-exec"]
}
}
}
Add this to your Claude Desktop configuration:
{
"mcpServers": {
"mcp-wsl-exec": {
"command": "npx",
"args": ["-y", "mcp-wsl-exec"]
}
}
}
The server implements two MCP tools:
Execute a command in WSL with safety checks and validation.
Parameters:
command
(string, required): Command to executeworking_dir
(string, optional): Working directory for command
executiontimeout
(number, optional): Timeout in millisecondsConfirm execution of a dangerous command that was flagged by safety checks.
Parameters:
confirmation_id
(string, required): Confirmation ID received from
execute_commandconfirm
(boolean, required): Whether to proceed with the command
executionThe server maintains a list of potentially dangerous commands that require explicit confirmation before execution, including:
All commands are sanitized to prevent:
pnpm install
pnpm build
pnpm dev
The project uses changesets for version management. To publish:
pnpm changeset
pnpm changeset version
pnpm release
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see the LICENSE file for details.
[
{
"description": "Execute a command in WSL",
"inputSchema": {
"properties": {
"command": {
"description": "Command to execute",
"type": "string"
},
"timeout": {
"description": "Timeout in milliseconds",
"type": "number"
},
"working_dir": {
"description": "Working directory for command execution",
"type": "string"
}
},
"required": [
"command"
],
"type": "object"
},
"name": "execute_command"
},
{
"description": "Confirm execution of a dangerous command",
"inputSchema": {
"properties": {
"confirm": {
"description": "Whether to proceed with the command execution",
"type": "boolean"
},
"confirmation_id": {
"description": "Confirmation ID received from execute_command",
"type": "string"
}
},
"required": [
"confirmation_id",
"confirm"
],
"type": "object"
},
"name": "confirm_command"
}
]