WSL命令执行
STDIOWindows子系统下安全命令执行服务器
Windows子系统下安全命令执行服务器
A Model Context Protocol (MCP) server for Windows + Claude Desktop users to interact with Windows Subsystem for Linux (WSL). Provides both read-only information gathering and secure command execution capabilities.
✅ You SHOULD use this if:
❌ You DON'T need this if:
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 provides 7 MCP tools:
These tools provide context about your WSL environment without making changes:
Get system information (OS version, kernel, hostname).
Parameters: None
Get directory contents and file information.
Parameters:
path (string, optional): Directory path (defaults to current directory)details (boolean, optional): Show detailed information (permissions, sizes, etc.)Get disk space information.
Parameters:
path (string, optional): Specific path to check (defaults to all filesystems)Get environment variables.
Parameters:
filter (string, optional): Filter pattern to search for specific variablesList running processes.
Parameters:
filter (string, optional): Filter by process nameUse these tools when you need to make changes or run custom commands:
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 millisecondsNote: Dangerous commands will require confirmation via confirm_command.
Confirm 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.