windows-terminal-mcp
windows-terminal-mcp
Ein MCP (Model Context Protocol)-Server, der es jedem LLM ermöglicht, Befehle in einem Windows-Terminal auszuführen – einschließlich lokaler Shells und Remote-SSH-Verbindungen.
Funktionen
Ausführen von Befehlen über
cmd,powershelloderbash(Git Bash)Ausführen von Remote-Befehlen über SSH mit schlüsselbasierter Authentifizierung
3-stufiges Sicherheitsmodell (sicher / bestätigen / blockiert)
Konfigurierbares Timeout pro Befehl
Funktioniert mit Claude Desktop und jedem MCP-kompatiblen Client
Related MCP server: Windows CLI MCP Server
Installation
git clone https://github.com/marttinm/windows-terminal-mcp.git
cd windows-terminal-mcp
pip install -e .Erfordert Python 3.11+ unter Windows.
Konfiguration
Fügen Sie den Server zu Ihrer Claude Desktop-Konfigurationsdatei hinzu (%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"windows-terminal": {
"command": "cmd",
"args": ["/c", "python", "-m", "windows_terminal_mcp.server"]
}
}
}Oder verweisen Sie direkt auf das Skript:
{
"mcpServers": {
"windows-terminal": {
"command": "cmd",
"args": ["/c", "python", "C:/path/to/windows-terminal-mcp/src/windows_terminal_mcp/server.py"]
}
}
}Tool: execute_command
Parameter
Parameter | Typ | Standard | Beschreibung |
| string | erforderlich | Auszuführender Befehl. Für SSH: |
| string |
| Shell: |
| string | — | Arbeitsverzeichnis (nur lokale Befehle) |
| integer |
| Timeout in Millisekunden |
| string | — | Pfad zum privaten SSH-Schlüssel (z. B. |
Antwort
{
"stdout": "...",
"stderr": "...",
"exit_code": 0,
"execution_time": 0.42
}Anwendungsbeispiele
Lokale Befehle
Run: dir C:\Users
Shell: cmd
Run: Get-Process | Select-Object -First 5
Shell: powershell
Run: git status
Shell: bashSSH-Befehle
Run: ubuntu@192.168.1.10 "df -h && uptime"
Shell: ssh
SSH key: ~/.ssh/id_rsaRun: ubuntu@192.168.1.10 "docker ps"
Shell: ssh
SSH key: ~/.ssh/my_key
Timeout: 30000Sicherheit
Befehle werden in drei Stufen klassifiziert:
Sicher — wird direkt ausgeführtecho, dir, type, git, npm, node, python, pip, curl und die meisten schreibgeschützten Befehle.
Gefährlich — Claude warnt vor der Ausführungdel, rmdir, rm, taskkill, net stop, net start, sc delete, reg add usw.
Blockiert — wird immer abgelehntformat, del /s /q, rd /s /q, reg delete, regedit, shutdown, net user, rm -rf, mkfs, fdisk und ähnliche destruktive Operationen.
Entwicklung
Projektstruktur
windows-terminal-mcp/
├── src/windows_terminal_mcp/
│ ├── __init__.py
│ ├── server.py # MCP server (main entry point)
│ ├── executor.py # subprocess execution
│ ├── main.py # simple stdin/stdout handler
│ └── security.py # command safety checks
├── tests/
│ └── test_windows_terminal_mcp.py
├── pyproject.toml
├── LICENSE
└── README.mdTests ausführen
pip install pytest
pytest tests/ -vAls Python-Modul verwenden
from windows_terminal_mcp.server import execute_command
result = execute_command("echo hello", shell="cmd")
print(result)
# {'stdout': 'hello\n', 'stderr': '', 'exit_code': 0, 'execution_time': 0.02}
result = execute_command(
"ubuntu@192.168.1.10 uptime",
shell="ssh",
ssh_key="~/.ssh/id_rsa",
timeout_ms=10000,
)
print(result)Changelog
v0.2.0
SSH-Unterstützung mit schlüsselbasierter Authentifizierung hinzugefügt
SSH-Befehlskonstruktion korrigiert (Host und Remote-Befehl werden als separate Argumente übergeben)
~-Erweiterung in SSH-Schlüsselpfaden unter Windows korrigiertstdin-Vererbung korrigiert, die dazu führte, dass SSH innerhalb des MCP-Serverprozesses hängen blieb
v0.1.0
Grundlegende Befehlsausführung über cmd, powershell, bash
Erfassung von stdout/stderr/exit_code
3-stufiges Sicherheitsmodell
Unit-Tests
Lizenz
MIT — siehe LICENSE
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
Related MCP Servers
- AlicenseAqualityFmaintenanceAn MCP server that enables secure terminal command execution, directory navigation, and file system operations through a standardized interface for LLMs.1034 PyPI97MIT
- AlicenseBqualityFmaintenanceA Model Context Protocol server that provides secure command-line access to Windows systems, allowing MCP clients like Claude Desktop to safely execute commands in PowerShell, CMD, and Git Bash shells with configurable security controls.9959 npm268MIT
- FlicenseAqualityDmaintenanceA local Model Context Protocol server that allows LLMs to securely execute shell commands on remote Linux and Windows systems via SSH connections.66 npm2-
- AlicenseBqualityAmaintenanceA secure MCP server for shell operations, terminal management, and process control, enabling AI assistants to safely execute commands and manage interactive sessions.13264 npm6MIT