windows-terminal-mcp
windows-terminal-mcp
Сервер MCP (Model Context Protocol), который позволяет любой LLM выполнять команды в терминале Windows, включая локальные оболочки и удаленные SSH-соединения.
Возможности
Выполнение команд через
cmd,powershellилиbash(Git Bash)Выполнение удаленных команд по SSH с аутентификацией по ключу
Трехуровневая модель безопасности (безопасно / подтверждение / заблокировано)
Настраиваемый тайм-аут для каждой команды
Работает с Claude Desktop и любым MCP-совместимым клиентом
Related MCP server: Windows CLI MCP Server
Установка
git clone https://github.com/marttinm/windows-terminal-mcp.git
cd windows-terminal-mcp
pip install -e .Требуется Python 3.11+ на Windows.
Конфигурация
Добавьте сервер в файл конфигурации Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"windows-terminal": {
"command": "cmd",
"args": ["/c", "python", "-m", "windows_terminal_mcp.server"]
}
}
}Или укажите путь напрямую к скрипту:
{
"mcpServers": {
"windows-terminal": {
"command": "cmd",
"args": ["/c", "python", "C:/path/to/windows-terminal-mcp/src/windows_terminal_mcp/server.py"]
}
}
}Инструмент: execute_command
Параметры
Параметр | Тип | По умолчанию | Описание |
| string | обязательно | Команда для выполнения. Для SSH: |
| string |
| Оболочка: |
| string | — | Рабочая директория (только для локальных команд) |
| integer |
| Тайм-аут в миллисекундах |
| string | — | Путь к закрытому SSH-ключу (например, |
Ответ
{
"stdout": "...",
"stderr": "...",
"exit_code": 0,
"execution_time": 0.42
}Примеры использования
Локальные команды
Run: dir C:\Users
Shell: cmd
Run: Get-Process | Select-Object -First 5
Shell: powershell
Run: git status
Shell: bashSSH-команды
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: 30000Безопасность
Команды классифицируются по трем уровням:
Безопасные — выполняются напрямую
echo, dir, type, git, npm, node, python, pip, curl и большинство команд только для чтения.
Опасные — Claude запросит подтверждение перед выполнением
del, rmdir, rm, taskkill, net stop, net start, sc delete, reg add и т. д.
Заблокированные — всегда отклоняются
format, del /s /q, rd /s /q, reg delete, regedit, shutdown, net user, rm -rf, mkfs, fdisk и аналогичные деструктивные операции.
Разработка
Структура проекта
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.mdЗапуск тестов
pip install pytest
pytest tests/ -vИспользование в качестве модуля Python
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)Журнал изменений
v0.2.0
Добавлена поддержка SSH с аутентификацией по ключу
Исправлено формирование SSH-команд (хост и удаленная команда передаются как отдельные аргументы)
Исправлено раскрытие
~в путях к SSH-ключам на WindowsИсправлено наследование stdin, из-за которого SSH зависал внутри процесса MCP-сервера
v0.1.0
Базовое выполнение команд через cmd, powershell, bash
Захват stdout/stderr/exit_code
Трехуровневая модель безопасности
Модульные тесты
Лицензия
MIT — см. LICENSE
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
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.
Related MCP Servers
- AlicenseAqualityFmaintenanceAn MCP server that enables secure terminal command execution, directory navigation, and file system operations through a standardized interface for LLMs.1080 PyPI94MIT
- 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.9419 npm265MIT
- FlicenseAqualityDmaintenanceA local Model Context Protocol server that allows LLMs to securely execute shell commands on remote Linux and Windows systems via SSH connections.62-
- AlicenseBqualityBmaintenanceA secure MCP server for shell operations, terminal management, and process control, enabling AI assistants to safely execute commands and manage interactive sessions.13158 npm6MIT