
Winrdp Mcp
io.github.emog33k由 GitHub 帳號 emog33k 發布v0.1.3更新於 Oct 24, 2026
Zero-config server to provision and administer any Windows RDP box over WinRM/SSH/SMB.
概覽
本機 MCP 伺服器,透過 WinRM、SSH 或 SMB 開通並管理 Windows RDP 主機,為助理提供 147 個工具,涵蓋命令列、檔案、服務、RDP 與圖形介面控制。
- 可以做什麼
- 管理主機清單:新增、列出、測試、診斷與開通主機,並依別名或標籤向多台主機平行派送腳本
- 執行命令與腳本:PowerShell、cmd、Python、Node 與批次檔,支援提權、互動式桌面執行與執行環境安裝
- 操作檔案與系統狀態:讀寫、搜尋、上傳下載、壓縮、ACL,以及登錄檔、服務、程序、排程工作、使用者、防火牆、事件記錄與軟體安裝
- 控制 RDP 與桌面:啟用或關閉 RDP、檢視工作階段、截圖、送出按鍵與滑鼠操作、透過 UI Automation 操作控制項、螢幕錄影
- 巡檢與加固:一鍵健康報告、套用基準設定、權限檢查、失敗登入、開放連接埠、Defender 狀態,以及 SSH 連接埠轉送與等待類工具
- 適用情境
- 適合需要讓助理建置或維運你擁有或獲授權管理的 Windows 機器時使用,尤其是尚未具備遠端管理能力的新雲端主機或 VDS,也適合在同一個助理工作階段中管理多台 Windows 主機。
- 執行需求
- 操作機需 Python 3.10+(Windows、macOS 或 Linux),目標機須為 Windows。可透過 pipx、uvx 或 pip 安裝。目標機需開放一種可用的管理通道(WinRM 5985/5986、SSH 22,或 SMB 445 加 DCOM 135),雲端業者防火牆連接埠需自行放行。每台主機需管理員憑證;SMB 冷啟動與機內 UI 代理需額外選用相依套件。透過 WINRDP_VAULT_KEY、WINRDP_PROFILE 等環境變數設定。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Winrdp Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
winrdp-mcp
A zero-config MCP server that provisions and fully administers any Windows RDP box — Windows 10/11 and Server 2016–2025 — for Claude and Claude Code.
[PyPI] [License: MIT] [Python 3.10+] [Platform: Windows] [MCP: FastMCP]
You give it a host and admin credentials. It makes the box remotely manageable by itself — turning on WinRM, opening the Windows firewall, and fixing local-admin token filtering — regardless of the box's starting state or Windows version. Claude then gets 147 tools: shell, files, registry, services, processes, scheduled tasks, users, firewall, event logs, software, networking, live RDP control, screenshots, GUI automation, real UAC elevation, one-call health/security reports, and on-demand tool staging — plus 6 guided workflows (prompts) and live host resources.
Nothing is pre-installed on the target. The controller reaches boxes over WinRM / SSH / SMB from wherever Claude Code runs, and manages one box or a whole fleet from a single server.
Why it's different
- Zero-config provisioning.
provision_hostclimbs a ladder — WinRM → SSH → SMB/WMI cold-start → paste-once bootstrap — and makes a fresh, locked-down box manageable with no manual WinRM setup. - Real UAC / elevation, not "please run as admin." Over WinRM a local admin gets a high-integrity full token and elevated ops run directly; a filtered token falls back to a one-shot
SYSTEMScheduled Task.as_user=Trueruns inside the interactive RDP desktop. - 147 tools across 15 modules, every one with
readOnlyHint/destructiveHintsafety annotations so MCP clients can gate destructive actions automatically. Narrow the surface to a focused set with a tool profile (WINRDP_PROFILE=admin|rdp|core). - Guided workflows & live context. 6 MCP prompts (
provision_and_harden,diagnose_box,fix_connection,security_audit,setup_dev_box,open_service_locally) turn a whole operation into one click, and resources (winrdp://hosts,winrdp://host/{alias}/info) hand the model the inventory and a live box summary without spending a tool call. - On-demand code execution.
run_pythonfinds or installs Python, pip-installs deps, runs your code, and cleans up — same for Node, PowerShell, cmd, and batch.stage_toolpulls Sysinternals (or any URL/local file) onto the box mid-task. - Native GUI automation. Drive the interactive RDP desktop — keystrokes, mouse, and UI Automation (find/click/read controls by name) — plus live screenshots, with no on-box agent.
- One-call ops.
health_report(OS/CPU/RAM/disk/services/errors/updates/Defender in one read),apply_baseline(high-perf power plan, no sleep, long paths),whoami_priv,failed_logons,list_open_ports. - First-class RDP and an encrypted multi-host inventory (Fernet) with tags and parallel fan-out across the fleet.
Two modes, one package
Both build the same server; python -m winrdp_mcp serve is equivalent to the console script.
Table of contents
- Quick start
- Tool groups
- Preparing a box
- Key capabilities
- Configuration
- Security
- Documentation
- Architecture
- Attribution & license
Quick start
1. Install
Python 3.10+ on the operator machine (Windows, macOS, or Linux). Targets are Windows.
Optional extras and a local dev checkout:
Claude Desktop, one click: grab winrdp-mcp.dxt from Releases and open it (Settings → Extensions → Install from file), or build it yourself with pwsh dxt/build.ps1.
2. Register with Claude Code
Drop a project .mcp.json at your repo root:
Or register from the CLI:
Set WINRDP_VAULT_KEY to a strong passphrase — it encrypts stored credentials at rest (see Configuration). Set WINRDP_PROFILE to admin, rdp, or core to expose a focused tool set instead of all 147.
3. The 30-second flow
Ask Claude to run these tools (arguments shown inline). Every tool takes an optional host= alias; omit it to hit the active host.
If the box has only RDP open, provision_host returns a bootstrap_oneliner to paste once into an RDP session — or call rdp_bootstrap, which copies that command to your clipboard and opens mstsc so you just paste it once. See Preparing a box.
Tool groups
147 tools across fifteen modules. The full catalog — every signature, parameter, default, and safety class — is in docs/TOOLS.md.
Safety classification across all 147: 50 read-only, 24 destructive, 73 mutating. Read-only tools are safe to auto-run; destructive tools carry destructiveHint=True so clients gate them behind confirmation.
Prompts & resources
Beyond tools, the server exposes MCP prompts (user-invoked, one-click operations that steer the model through the right tool sequence) and resources (bounded read-only context the client can hand the model for free):
Tool profiles
WINRDP_PROFILE selects which modules to expose, so the model's tool list stays focused:
dynamic is the recommended profile for large/long sessions: it follows the 2026 MCP
guidance on tool-list bloat. Only ~41 core tools load up front; the model calls
enable_toolset("rdp") (etc.) to grow its tool list exactly when a task needs it, and
disable_toolset(...) to shrink it again. Everything is still reachable — nothing is removed.
Preparing a box
The controller needs the target reachable on one management transport. In the best case (WinRM already up) provision_host does everything. The only two things you may have to do by hand on a brand-new cloud box are:
- Open one management port inbound in the provider firewall / security group (5985 for WinRM-HTTP, or 5986 for HTTPS) — this is outside Windows and winrdp-mcp cannot do it for you.
- Turn on a transport once — either paste the enable-WinRM one-liner into an RDP session, or let the SMB/WMI cold-start do it.
Print the paste-once one-liner any time:
Full walkthrough — provider-firewall specifics (AWS/Azure/GCP/Hetzner/…), the cold-start rungs, RDP hardening, verification, and a "new box in 3 minutes" runbook — in docs/PREPARE-SERVER.md.
Key capabilities
Provisioning ladder
provision_host tries the best rung first and stops at the first that works (winrdp_mcp/provision.py):
- WinRM (5985/5986) reachable → use it, re-run the idempotent enable script to harden.
- SSH (22) reachable → use it, and turn WinRM on over the SSH channel for the richer path.
- SMB (445) + DCOM (135) only → stage the enable script over
ADMIN$and trigger it fire-and-forget over WMI ([bootstrap]extra), then switch to WinRM. - Nothing but RDP → return a
bootstrap_onelinerto paste once; then everything is remote.
The enable script opens the WinRM firewall rule, flips a Public network profile to Private, and sets LocalAccountTokenFilterPolicy=1 so a non-builtin local admin gets a full token over the network.
Elevated & interactive execution
Over WinRM a full-token admin runs elevated=True directly (fast path); a filtered token (SSH / non-elevated local) falls back to a one-shot SYSTEM Scheduled Task. as_user=True runs inside the visible desktop session — needed for GUI, clipboard, and screenshots.
Run any script in one call
run_python with ensure_python=True (default) locates Python or installs it detached (winget → choco → python.org), resolving the concrete python.exe by glob so it works the same session. Long installs run as a Scheduled Task and poll a done-marker, so a mid-install WinRM disconnect doesn't fail them.
Parallel fan-out across the fleet
run_on_hosts runs one script across many boxes concurrently (default max_parallel=8) and returns per-host {stdout, stderr, rc} keyed by alias. Select by aliases (CSV), by tag, or omit both to hit every box.
First-class RDP control
rdp_connection_file generates a .rdp and stores the password via cmdkey on the operator machine — it is never returned to the model or written into the .rdp file. install_rdp_wrapper enables concurrent sessions on client SKUs.
On-demand tooling
Presets: psexec, handle, procdump, autoruns, tcpview, pslist, accesschk, sigcheck. Everything caches under C:\ProgramData\winrdp-mcp\tools; URLs and presets download on the box, local files are uploaded.
Configuration
All configuration is via environment variables (set them in the env block of your .mcp.json).
Logging goes to stderr only — on the stdio transport, stdout is the MCP JSON-RPC channel. Known secrets are redacted from logs by exact match plus structural patterns.
Security
winrdp-mcp is admin tooling for boxes you own or are authorized to manage. It is a remote code-execution surface by design.
- Permissive first contact. Defaults favor zero-setup provisioning:
winrm_cert_validation="ignore"andssh_host_key_policy="auto"(trust-on-first-use). On an untrusted network this allows an on-path attacker to MITM. For production, register withadd_host(..., use_ssl=true, winrm_port=5986, winrm_cert_validation="validate", ssh_host_key_policy="reject")and restrict the firewall to your operator IP. - NTLM encrypts the payload over HTTP 5985. The default
winrm_auth="ntlm"seals the message body even without TLS. The enable script deliberately does not turn onBasic/AllowUnencrypted/TrustedHosts=*(0.1.1+) — NTLM needs none of them, and they'd only weaken the box. - Secrets on the box are transient.
user_create/service_createstage the new password to an admin-only file read on the box (kept off the process command line / Event 4688);cmdkeystores the RDP password on the operator machine. None are ever returned to the model, and logs redact known secrets. - Least privilege. Narrow the tool surface with
WINRDP_ENABLED_TOOLS/WINRDP_DISABLED_TOOLS, and keep destructive-action confirmation on in your client. - Behind a proxy/VPN that breaks NTLM? A rotating proxy (e.g. Clash in TUN mode) breaks connection-oriented NTLM — the multi-leg handshake needs one persistent TCP connection it won't preserve, so WinRM auth fails even with the right password (you'll see
InvalidCredentialsdespite a valid login). Route the box IPs DIRECT in the proxy, or enable stateless Basic auth:rdp_bootstrap(enable_basic=True)(orenable_winrm(basic=True)) turns on Basic + AllowUnencrypted on the box, then register withadd_host(..., winrm_auth="basic"). Basic over HTTP sends the password near-cleartext, so scope WinRM to your operator IP at the provider firewall. - Server-side confirmation (optional). Set
WINRDP_CONFIRM_DESTRUCTIVE=1to make the server itself ask you to confirm (via MCP elicitation) before any destructive tool runs — a safety net for clients that don't gate ondestructiveHint. Clients without elicitation support fall back to that client-side gating.
Full threat model, credential-vault internals, log redaction, argument-injection defenses, and a hardening checklist: docs/SECURITY.md.
Documentation
Architecture
winrdp-mcp is a FastMCP server: tools call a shared Context that resolves the target host from an encrypted vault, hands the PowerShell body to a cached Transport (WinRM / SSH / Local / SMB+WMI), and marshals delimited JSON back — nothing above the transport layer knows how the command reached the box. Full internals in docs/ARCHITECTURE.md.
Attribution & license
Built on and gratefully crediting two MIT-licensed projects — see NOTICE:
- winremote-mcp — basis for the on-box tool surface, the risk-tier model, and the optional
deploy_ui_agentinteractive-desktop path. - windows-admin-mcp — basis for the WinRM-primary / SSH-fallback administration approach.
winrdp-mcp's own additions: the zero-config provisioning ladder, real UAC/elevation via one-shot Scheduled Tasks, on-demand tool staging, the encrypted multi-host inventory, and first-class RDP control.
來源:README.md,提交 fec1d38
工具
0版本歷史
1- v0.1.3最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分