loading…
Search for a command to run...
loading…
Hardened MCP server providing controlled access to PowerShell, CMD, Git Bash, and SSH from MCP clients like Claude Desktop.
Hardened MCP server providing controlled access to PowerShell, CMD, Git Bash, and SSH from MCP clients like Claude Desktop.
Hardened MCP server for Windows CLI and SSH interactions. Provides controlled access to PowerShell, CMD, Git Bash, and remote systems via SSH from MCP clients like Claude Desktop.
This is a maintained, hardened fork:
SimonB97/win-cli-mcp-server (original, development stalled) -> delorenj/super-win-cli-mcp-server (super-win-cli variant) -> this repo (bug fixes, hardening, dependency updates)
The original project is no longer actively maintained. This fork fixes critical bugs, updates dependencies, and is used in production daily.
windowsHide: true to child_process.spawn(). Shell windows no longer flash on screen during MCP execution.Client instance, causing memory leaks. Fixed by creating a fresh Client on each reconnect and using .once() for connection-scoped events.output || errorOutput). Now both streams are combined.config.json caused JSON.parse() to throw, silently falling back to restrictive defaults. BOM is now stripped before parsing.@modelcontextprotocol/server-memory-dynamic pointed to file:../servers/src/memory (author's local dev path). Removed.password or privateKeyPath. If neither was specified, the entire config load failed. Now optional -- ssh2 falls back to ssh-agent automatically.resolveCommandPath, isPathAllowed, validateWorkingDirectory, normalizeWindowsPath (exported but never imported). Unused imports (exec, promisify) also removed.@types/ssh2 moved to devDependencies -- Type packages don't belong in production deps.Add to your claude_desktop_config.json:
{
"mcpServers": {
"win-cli": {
"command": "node",
"args": [
"C:/path/to/win-cli-mcp-server/dist/index.js",
"--config",
"C:/path/to/win-cli-mcp-server/config.json"
]
}
}
}
Or clone and set up:
git clone https://github.com/mhprol/win-cli-mcp-server.git
cd win-cli-mcp-server
npm install
npm run build
Copy config.example.json to config.json and customize:
{
"security": {
"maxCommandLength": 50000,
"blockedCommands": [],
"blockedArguments": [],
"allowedPaths": [],
"restrictWorkingDirectory": false,
"logCommands": true,
"maxHistorySize": 2000,
"commandTimeout": 600,
"enableInjectionProtection": false
},
"shells": {
"powershell": {
"enabled": true,
"command": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
"args": ["-NoProfile", "-NoLogo", "-NonInteractive", "-Command"],
"blockedOperators": []
},
"cmd": {
"enabled": true,
"command": "cmd.exe",
"args": ["/c"],
"blockedOperators": []
},
"gitbash": {
"enabled": true,
"command": "C:\\Program Files\\Git\\bin\\bash.exe",
"args": ["--norc", "-c"],
"blockedOperators": []
}
},
"ssh": {
"enabled": true,
"defaultTimeout": 30,
"maxConcurrentSessions": 5,
"keepaliveInterval": 10000,
"keepaliveCountMax": 3,
"readyTimeout": 20000,
"connections": {
"my-server": {
"host": "192.168.1.100",
"port": 22,
"username": "user",
"privateKeyPath": "C:\\Users\\you\\.ssh\\id_ed25519"
}
}
}
}
SSH authentication priority: explicit key > password > ssh-agent (automatic).
Config notes:
config.json is gitignored to protect credentials. Use config.example.json as template.command paths should point to the actual executable (e.g., pwsh.exe for PS7, not powershell.exe for PS5.1).| Tool | Description |
|---|---|
execute_command |
Run a command in PowerShell, CMD, or Git Bash |
get_command_history |
Retrieve history of executed commands |
ssh_execute |
Execute a command on a configured remote host |
ssh_disconnect |
Close an SSH connection |
This server provides direct access to your system's command line and remote systems via SSH. The default configuration is intentionally open for trusted single-user environments. For shared or exposed setups:
restrictWorkingDirectory and set allowedPathsblockedCommands and blockedArgumentsenableInjectionProtectionblockedOperators per shellwin-cli-mcp-server authorsuper-win-cli fork with extended configMIT -- see LICENSE.
Выполни в терминале:
claude mcp add win-cli-mcp-server -- npx Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development