Skip to main content
Glama

windows-gui is a production-grade Antigravity plugin and standalone MCP server that gives AI agents fast, reliable, semantic-first control over the entire Windows desktop — from standard WinUI/UWP/Tauri/Electron apps and normal logged-in browsers, to zero-UIA self-drawn apps (e.g. WeChat 4.x Qt5, HTML5 <canvas>), Windows 11 OS controls, rich clipboards, and (optionally) elevated Administrator windows.

All 27 MCP tools run with zero GPU, zero OpenCV, zero NumPy, and zero Playwright dependencies — only Python stdlib, Pillow, mcp<2, native Win32/WinRT APIs, and the upstream Rust CLI vercel-labs/agent-desktop (downloaded and SHA-256 verified automatically by scripts/setup.ps1).

Windows GUI MCP v2.0 4-Tier Perception Architecture & 6–45× Warm Benchmarks


Why windows-gui?

Dimension

Pure-VLM Computer Use

OmniParser + SoM

Playwright / Browserbase

Raw Desktop Drivers / RPA

windows-gui v2.2 (27 Tools)

Control Scope

Full desktop (pixel-only)

Full desktop

Browser tabs only

Full desktop (standard integrity)

Full OS + Optional Admin UIPI + Win11 Shell + Rich Clipboard + Opt. CDP

Perception Routing

100% raw pixel guessing

Extra GPU YOLO + Caption models

DOM / CDP

UIA tree only (breaks on Qt/Canvas)

4-Tier Routing: Opt. stdlib CDP → UIA/TextPattern → Warm Dual-Pass OCR → Pure-PIL NCC Icon Match & Pixel Probe

Execution Latency

1 step = 1 LLM turn + blind sleep

1 step = 1 LLM turn + vision pass

Fast inside browser

Cold subprocess per call (500–2000 ms)

In-Process + Warm PS Worker (6–45× faster) + 1-Turn gui_batch (up to 25 steps)

CJK IME & Clipboard

Keystrokes break on CJK IME

Same

Native DOM fill

Overwrites user clipboard

UIA set-value → Lossless multi-format paste (CF_DIB/HTML/RTF) → Auto-paced KEYEVENTF_UNICODE

Privilege Isolation

Blocked by UIPI

Blocked by UIPI

N/A

Blocked by UIPI or leaks admin token

Elevated control plane + Win32 Shell Token Drop (normal apps launch at Medium Integrity)

Competitive Landscape & Smart Privilege / HITL Boundary


Related MCP server: AiPC

Quick Start

Prerequisites

  • Windows 10 / 11 (x64 or ARM64)

  • Python 3.10+ available in PATH (python --version)

  • PowerShell 5.1+ (built into Windows)

1. Install the Plugin or Standalone MCP Server

Option A — Antigravity CLI (Recommended for Antigravity):

agy plugin install https://github.com/ruol1/windows-gui-mcp

Option B — Manual Clone (Antigravity App / IDE / Any MCP Client):

git clone https://github.com/ruol1/windows-gui-mcp.git "$env:USERPROFILE\.gemini\config\plugins\windows-gui"

2. Run One-Command Setup (Persistent Mode A Default: Deps + agent-desktop.exe + Tray Daemon)

For repository cleanliness and security, the upstream third-party binary agent-desktop.exe is not committed to Git. scripts/setup.ps1 installs mcp<2 + Pillow, downloads v1.3.1 directly from official vercel-labs/agent-desktop GitHub Releases with SHA-256 verification, and configures the persistent local Streamable HTTP daemon (Mode A, recommended) with auto-start at logon, zero battery/timeout throttling, automatic crash recovery, a Start Menu relaunch shortcut, and the minimal system tray icon.

cd "$env:USERPROFILE\.gemini\config\plugins\windows-gui"

# Default (Recommended): Elevated Mode A persistent daemon (one UAC prompt; supports Admin windows + Tray icon)
powershell -ExecutionPolicy Bypass -File .\scripts\setup.ps1

# Optional: Non-UAC persistent Mode A (no UAC prompt; still gets Tray icon & auto-start, skips Admin windows)
powershell -ExecutionPolicy Bypass -File .\scripts\setup.ps1 -Standard

# Optional: Stdio-only Mode B (no background daemon or tray icon)
powershell -ExecutionPolicy Bypass -File .\scripts\setup.ps1 -StdioOnly
  • Listens strictly on 127.0.0.1:18765/mcp with a 48-character random Bearer token (NTFS ACL-locked to your user + Administrators + SYSTEM) and rejects browser Origin headers to prevent CSRF.

  • Runs as a native interactive AtLogOn Windows Scheduled Task with 4 reliability safeguards (AtLogOn, ExecutionTimeLimit=0, DontStopIfGoingOnBatteries, RestartCount=3) and a minimal pure-Win32 system tray icon (one-click disable/enable AI control, Esc/mouse-override toggles, redacted audit log viewer, clean exit + Start Menu relaunch).

  • Even when elevated, auto-launching everyday apps (Chrome, WeChat, Office, UWP) uses Win32 CreateProcessWithTokenW with the desktop shell token so apps start cleanly at Medium Integrity with zero admin quirks.

  • Restart or enable Windows GUI Automation in Antigravity (Customizations → Installed → MCP Servers). Revert to Stdio mode at any time via .\scripts\uninstall_elevated_service.ps1.

Using with Any MCP Client (Claude Desktop, Claude Code, Cursor, Codex, Windsurf)

windows-gui-mcp is a 100% standard MCP server — not locked to Antigravity. Connect any MCP client either to the persistent local Streamable HTTP endpoint generated in mcp_config.json (http://127.0.0.1:18765/mcp + Authorization: Bearer <token>), or directly via Stdio:

{
  "mcpServers": {
    "windows-gui": {
      "command": "python",
      "args": [
        "-X",
        "utf8",
        "C:/path/to/windows-gui-mcp/skills/windows-gui/scripts/mcp_server.py",
        "--transport",
        "stdio"
      ]
    }
  }
}

Tip: Copy skills/windows-gui/SKILL.md into your client's skills/instructions folder so the agent automatically uses the 4-tier routing strategy, macro HUD task labels, and app playbooks.


Key Capabilities & Performance Benchmarks

Measured v1.0 Cold vs v2.0 Warm Latency (Windows 11, 2560×1600 @ 150% DPI)

v2.0 executes gui_assist commands in-process (eliminating ~250–350 ms python.exe cold starts), shares a self-healing persistent warm PowerShell JSON-RPC worker (win_worker.ps1 / ps_worker.py), and captures screen regions directly via Win32 GDI BitBlt:

Operation

v1.0 Cold Subprocess

v2.0 Warm / In-Process

Speedup

Dual-Pass WinRT OCR (47 Chinese lines, normal + white-text mask)

~1,500–2,000 ms

152.3 ms

6.1× – 10×

Core Audio Master Volume (get_volume)

~800–1,200 ms

20.1 ms

~45×

Process Snapshot (list_processes)

~550 ms

24.8 ms

~22×

WMI Display Brightness (get_brightness)

~650 ms

93.9 ms

~7×

Full-Screen 2560×1600 → 1280px JPEG (screen=True)

~450–600 ms

86.3 ms (GDI BitBlt)

~6×

Cropped Region Capture (popups / input boxes)

~400 ms

6.8 – 16.1 ms

~30×

UIA Document Text Extraction (Calculator)

723.5 ms

288.3 ms

2.5×

Worker Crash Auto-Respawn (taskkill /F → transparent recovery)

N/A

493.1 ms

Zero error

All 27 MCP Tools (windows-gui_desktop)

Category

Tools

Highlights

Safety HUD, Tray & Audit

gui_control

Codex-style capture-excluded (WDA_EXCLUDEFROMCAPTURE) matte obsidian macro-task pill (set_task / friendly app fallback), diffused screen edge aura, smooth ease-out cursor glide & auto focus restore (both ON by default), minimal system tray daemon, hardware Esc/double_esc/mouse_override stop (6 s auto-reset), persisted preferences & redacted audit_log

Diagnostics & Recovery

gui_doctor, gui_recover

Verifies WinSta0\Default, elevation, DPI, SnapshotOK, PowerShellWorker, & SafetyOverlay; kills stuck helpers, recycles worker, hardens AGENT_DESKTOP_HOME DACL, hot-reloads modules

Window & App Lifecycle

gui_list_windows, gui_window_action

EN/ZH app discovery via Registry App Paths, Start Menu .lnk (uninstaller/CMD-filtered), Store UWP (Get-StartApps), & URI schemes (ms-settings:*); DWM-aware snap_left/snap_right/center/move_to_monitor/set_topmost

4-Tier Perception

gui_browser_cdp, gui_extract_text, gui_snapshot, gui_find, gui_get, gui_annotate, gui_ocr_find, gui_screenshot, gui_find_image, gui_inspect_point

Optional stdlib RFC 6455 CDP (Shadow DOM); UIA TextPattern + WM_GETOBJECT wake + Document-cropped dedup OCR; 8-snapshot LRU ref cache; pure-PIL 3-stage NCC icon matcher (alpha-mask aware); RGB/cursor/caret probe; 4-edge coordinate ruler

Full Win32 Input

gui_click, gui_check, gui_interact, gui_press, gui_mouse_click, gui_scroll, gui_drag, gui_smart_input

40B x64 SendInput ABI: middle/x1/x2 + modifier clicks, horizontal HWHEEL, Ctrl+wheel, multi-point path drag, UIA set-value, lossless clipboard paste, and auto-paced CJK KEYEVENTF_UNICODE

Waits & 1-Turn Macros

gui_wait, gui_batch

Smart waits (title_changed in 0.3 ms, dialog_appear, element_appear/gone, ocr_appear/gone, visual_changed/stable); chain 1–25 steps with merged clipboard backup & inline screenshots

OS Controls & Clipboard

gui_system, gui_clipboard

Localized Win11 shell surfaces, headless WinRT notifications, Core Audio volume, WMI brightness, virtual desktops, keep-awake, processes, multi-monitor; rich clipboard (text, PNG/CF_DIB, CF_HDROP files, CF_HTML, CF_RTF)


Verification, Stress Testing & Automated Regression Suite

Every capability in v2.0 has been stress-tested across a zero-UIA / zero-text / paste-blocked HTML5 <canvas> adversarial bench (CanvasLab) and 6 heterogeneous Windows UI stacks (WeChat 4.x Qt 5.15, Codex MSIX/UWP, Clash Verge Tauri/WebView2, Antigravity heavy Electron with 5,000+ nodes, Chrome 158 CDP, and elevated WinUI/Admin apps). See the full report in docs/TEST_REPORT_v2.md.

v2.0 Adversarial Eval & 6-Framework Real Desktop App Matrix

Run the zero-dependency unittest regression suite anytime (33/33 tests pass in ~13s, including WDA_EXCLUDEFROMCAPTURE continuous multi-turn Task Session HUD & watchdog, smooth cursor glide + pre-click pause, auto focus restore, OS-language localized Win32 tray icon, privacy-redacted audit log rotation, physical vs injected Esc/double_esc/mouse_override hooks, CJK pacing, worker taskkill recovery, and a built-in mock RFC 6455 CDP server):

# Offline unit + integration + worker crash-recovery + mock RFC 6455 CDP tests
python -X utf8 tests/run_tests.py

# Also run live headless Chrome/Edge CDP E2E (open Shadow DOM + CJK Input.insertText)
python -X utf8 tests/run_tests.py --live-cdp

Security & Human-in-the-Loop (HITL) Boundaries

  • Loopback-Only & Token-Locked: Both the optional Streamable HTTP daemon (127.0.0.1:18765) and gui_browser_cdp strictly enforce loopback hosts (127.0.0.1 / localhost / ::1) and reject cross-origin browser requests.

  • No Privilege Leakage: Elevated mode launches normal user apps via Win32 Shell Token Drop (Medium Integrity) and applies 2-step NTFS DACL hardening on AGENT_DESKTOP_HOME.

  • Strict HITL Walls: Bundled agent instructions (skills/windows-gui/SKILL.md) explicitly prohibit bypassing Windows UAC Secure Desktop prompts, CAPTCHAs, account login/2FA, or payment confirmations — handing control back to the human whenever those walls appear.


License & Acknowledgments

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables comprehensive Windows desktop automation including screen capture, OCR text extraction, mouse/keyboard control, window management, process control, and clipboard operations through 25+ tools for AI agents.
      37 PyPI
      8
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Gives AI agents full control of a Windows computer over MCP through 63 native tools — screenshots and UI trees for vision, mouse/keyboard input, Chrome control via CDP, plus files, terminal, processes, and SSH/SFTP. The agent can look at the screen, click, type, launch apps, run commands, and verify each step with a fresh screenshot.
      43
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP-capable AI agents to control Windows desktops through UI Automation element trees, native screenshots, app launching, batched action sequences, smart waits, and safety gates using normalized coordinates.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Windows desktop automation through a unified 29-tool MCP surface combining UI Automation, OCR, browser DOM reading, screenshots, window management, mouse/keyboard control, app launching, and notifications while intercepting dangerous calls.
      2
      MIT