Metadata-Version: 2.4
Name: mcp_winrm
Version: 1.1.2
Summary: WinRM-based MCP Server (基于 WinRM 的 MCP 服务器，纯 Python 实现)
Author: Junki
License: ISC
Keywords: winrm,mcp,server,powershell,windows
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp<3,>=2.0
Requires-Dist: pywinrm>=0.5.0
Requires-Dist: requests-ntlm>=1.2.0

# winrm-mcp-server

基于 WinRM 的 MCP (Model Context Protocol) 服务器，纯 Python 实现，通过 pywinrm 在远程 Windows 主机上执行 PowerShell/CMD 命令。

## 功能

- **execute-command**：远程执行 PowerShell 或 CMD
- **list-connections**：列出已配置连接
- **add-connection / remove-connection / rename-connection**：管理 `config/connections.json`
- **history**：查看命令执行历史

## 传输

- **stdio**：本地 MCP 客户端直连
- **http**：Streamable HTTP，默认端口 **8971**，路径 `/mcp`

## 快速启动

```bash
pip3 install -r requirements.txt
python3 -m winrm_mcp --transport http --http-port 8971 --http-host 0.0.0.0
```

## 配置文件

`config/connections.json`（参考 `connections.example.json`）

## Windows 端要求

目标主机需启用 WinRM（5985 HTTP 或 5986 HTTPS）：

```powershell
Enable-PSRemoting -Force -SkipNetworkProfileCheck
```

认证使用 NTLM（`requests-ntlm`），与 Windows 默认 WinRM 配置兼容。

## 设计文档

完整设计文档见 [`docs/`](docs/README.md)（系统设计、详细设计、接口契约、部署、配置、日志）。

## systemd 部署

```bash
./deploy/auto_update.sh install
```
