Skip to main content
Glama

Windows Computer Use MCP

CI License: MIT PyPI Python MCP Registry

Zero-disturbance computer use for Windows, as an MCP server. Let an AI agent drive native Windows apps (Win32, WPF, WinUI, Electron, Java, Qt) without stealing your mouse, keyboard or focus while you keep working.

Works with any Model Context Protocol client: Claude Desktop, Claude Code, Google Antigravity, Cursor, VS Code and others.

Português: veja docs/README.pt-BR.md.

Why

Most computer-use tools move the real cursor and type into whatever window has focus. If you touch the mouse at the wrong moment, the agent types into your browser. This server is built around the opposite default:

  • Background first. Clicks and typing are posted to the target window (WM_* messages, UI Automation patterns) without taking OS focus.

  • User-Activity Guard. Before any foreground input it checks GetLastInputInfo; if you moved the mouse or typed recently it aborts with reason: "user_active".

  • Strict focus lock. During SendInput the target is re-verified every 16 characters; if focus moves it aborts with reason: "focus_lost" and restores your cursor and window.

  • No blind global typing. type_text and press_keys require a target window unless allow_global=True.

  • Somewhere else to work. Apps can run on a virtual monitor (Virtual Display Driver) or on a hidden isolated desktop (CreateDesktopW, no admin rights).

  • Occlusion-proof capture. PrintWindow + PW_RENDERFULLCONTENT captures a window even when it is covered or off-screen, with optional grid and Set-of-Mark badges for UI elements.

Related MCP server: NexusWindows

Demo

Notepad (Windows 11) filled in the background through UI Automation while the window was not the one in focus, then captured with PrintWindow. Real output of the server's own fill_field and capture_window:

Windows 11's new Notepad ignores posted WM_CHAR messages. Since 0.4.0, type_text(mode="background") reads the control back, falls back to UI Automation when needed, and reports delivery: verified | unverified | not_delivered instead of claiming success blindly (#22).

Tools

Tool

What it does

display_status

Physical/virtual monitors, VDD status, recommended agent monitor

user_idle_status

Milliseconds since last user input and the foreground window

list_windows

Windows with HWND, title, process, monitor and rects

move_window_to_display, launch_app_on_display

Put an app on a given (virtual) monitor

launch_on_isolated_desktop, list_isolated_windows

Run apps on a hidden desktop

capture_window, capture_monitor

Screenshots, with optional grid / element marks

inspect_ui

UI Automation tree of a window

click, click_element, drag, scroll

Pointer actions (background by default)

type_text, press_keys

Keyboard actions with guards

fill_form

Batch-fill Edit/CheckBox/Radio/ComboBox fields and submit

Install

Requires Windows 10/11 and Python 3.11+. The easiest way is uv.

Run it from PyPI:

uvx windows-computer-use-mcp

Or straight from GitHub (latest main):

uvx --from git+https://github.com/jeanluyac-sketch/antigravity-computer-use windows-computer-use-mcp

Or clone for development:

git clone https://github.com/jeanluyac-sketch/antigravity-computer-use
cd antigravity-computer-use
uv venv
uv pip install -e ".[dev]"

Claude Desktop

Step-by-step guide with first prompts and troubleshooting: docs/claude-desktop.md. Check your install with uvx windows-computer-use-mcp --doctor.

Add to %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "windows-computer-use": {
      "command": "uvx",
      "args": ["windows-computer-use-mcp"]
    }
  }
}

Claude Code

claude mcp add windows-computer-use -- uvx windows-computer-use-mcp

Google Antigravity

Copy plugin-template\ to %USERPROFILE%\.gemini\config\plugins\computer-use\ and set the paths in mcp_config.json to your clone. The plugin also ships a skill (skills/computer-use/SKILL.md) that teaches the agent the safe workflow.

Cursor / other clients

Use the same command + args as the Claude Desktop example in your client's MCP config.

User-Activity Guard threshold

Set WCU_IDLE_THRESHOLD_MS in the server process environment to change the default idle time required before foreground input. For example, add this next to command and args in the MCP client configuration:

"env": { "WCU_IDLE_THRESHOLD_MS": "2000" }

The value is a positive integer in milliseconds, read when the server starts. Restart the server after changing it. Unset, empty, noninteger, zero or negative values fall back to 1200 ms. An explicit user_idle_ms tool argument takes precedence. Existing focus locks and background-input behavior still apply.

Docker and directory checks (not a Linux server)

This server only works on Windows 10/11: it drives Win32 and UI Automation. The repository still ships a Dockerfile and glama.json because MCP directories run automated checks in Linux containers. In that image the server starts in introspection mode: initialize and tools/list return the real tool names and schemas, and every tool call returns an error saying it only works on Windows. --version, --help and --doctor work anywhere. For real use, run uvx windows-computer-use-mcp on Windows.

Compatibility

Which apps work in the background is tracked in docs/compatibility.md. Please add the apps you try.

Optional extras

  • Virtual Display Driver: scripts\install-vdd-admin.cmd (asks for UAC) installs a virtual monitor; scripts\manage-vdd.ps1 manages it. The agent then works on a screen you are not looking at.

  • Browser automation without focus: scripts\start-brave-cdp.cmd opens Brave on a dedicated profile with --remote-debugging-port=9222, for use with chrome-devtools-mcp.

  1. display_status and list_windows (or user_idle_status before any foreground input).

  2. Isolate the app: launch_app_on_display, move_window_to_display or launch_on_isolated_desktop.

  3. Observe: inspect_ui(hwnd=..., with_screenshot=true) or capture_window(hwnd=..., include_grid=true).

  4. Act: fill_form, click_element, type_text(..., mode="background"), click(..., mode="message").

  5. Only if an app ignores background messages, use mode="paste" / mode="sendinput" with wait_for_idle_seconds and restore_focus=True.

Tests

The end-to-end suite opens a real WinForms dialog, captures it, fills it and checks the guards. Run it on a Windows machine with an interactive desktop:

python tests\test_computer_use.py

Platform-independent unit tests run anywhere: python -m pytest tests/test_meta.py tests/test_input_config.py tests/test_delivery.py tests/test_hosted.py.

CI runs lint, unit tests, a build and an import/tool-registration smoke test on windows-latest (plus the unit tests on Ubuntu).

Security

This server can click and type on your computer. Only connect it to clients and prompts you trust, and read SECURITY.md to report a vulnerability privately.

Contributing

Contributions are welcome, including docs and translations, and you do not need Windows for docs work.

  1. Pick an issue labelled good first issue and comment that you will take it.

  2. Follow CONTRIBUTING.md (English) or docs/CONTRIBUTING.pt-BR.md (Português).

  3. Open a small, focused pull request.

Questions or ideas? Open an issue or a discussion, in English or Portuguese.

License

MIT

Available Tools

17 tools
capture_monitorB

Capture an entire monitor (defaults to virtual display if active, else secondary/primary).

Inputs: max_width, save_path, include_grid, monitor_index.

capture_windowC

Capture a specific window via PrintWindow (works even when occluded or on a virtual display).

Inputs: hwnd, max_width, save_path, client_only, +4 more.

clickB

Click at coordinates. Defaults to silent background mode='message' (zero focus steal).

If mode='sendinput' is needed, User-Activity Guard + Strict Focus Lock + Focus/Cursor Restore protect the user's active window from interference.

Inputs: x (required), y (required), hwnd, mode, +13 more. Returns: result

click_elementA

Click/invoke a UI element by cached element_id (from inspect_ui), name, or automation_id.

Uses background UI Automation patterns first (zero cursor/focus hijack) with guarded SendInput fallback.

Inputs: hwnd, name, element_id, control_type, +4 more. Returns: result

display_statusA

List all physical and virtual monitors, Virtual Display Driver status, and recommended agent monitor.

Inputs: no named parameters. Returns: result

dragC

Drag mouse from (x1, y1) to (x2, y2) with User-Activity Guard and cursor/focus restore.

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +10 more. Returns: result

fill_formC

Batch-fill multiple form fields (Edit, CheckBox, RadioButton, ComboBox) via UIA and optionally submit.

Inputs: fields (required), hwnd, submit_button, restore_cursor, +4 more. Returns: result

inspect_uiC

Inspect Windows UI Automation controls of a target window and assign cached element IDs (e1, e2, ...).

Inputs: hwnd, max_depth, max_elements, title_contains, +3 more.

launch_app_on_displayC

Launch an application and automatically move its window onto the virtual or target display.

Inputs: command (required), args, width, height, +4 more. Returns: result

launch_on_isolated_desktopA

Launch an app on a completely hidden Win32 desktop (WinSta0\AntigravityDesktop).

Apps running on an isolated desktop have their own independent window stack and focus, so they physically cannot steal focus or interfere with the user's desktop, mouse, or browser.

Inputs: command (required), cwd, args, desktop_name. Returns: result

list_isolated_windowsC

List visible windows running on the isolated hidden Windows desktop.

Inputs: desktop_name, title_contains, process_contains. Returns: result

list_windowsB

List open Windows desktop windows with HWND, title, process, monitor index, and bounding rects.

Inputs: visible_only, monitor_index, title_contains, process_contains. Returns: result

move_window_to_displayC

Move (and optionally resize/maximize) a window onto the virtual or designated agent monitor.

Inputs: hwnd, width, height, activate, +4 more. Returns: result

press_keysB

Press a key or chord. Requires hwnd/title_contains unless allow_global=True.

Single keys default to background WM_KEYDOWN/WM_KEYUP; chords use guarded SendInput with focus restore.

Inputs: keys (required), hwnd, mode, focus, +7 more. Returns: result

scrollC

Scroll vertically (defaults to background mode='message' when hwnd/title_contains is given).

Inputs: delta (required), x, y, hwnd, +7 more. Returns: result

type_textB

Type Unicode text safely. Requires hwnd/title_contains unless allow_global=True.

  • mode='background' (default): posts WM_CHAR directly to the target window without stealing focus.

  • mode='paste': clipboard paste guarded by User-Activity Guard + Strict Focus Lock + Focus Restore.

  • mode='sendinput': Unicode typing in 16-char chunks with focus verification before EVERY chunk.

Inputs: text (required), hwnd, mode, focus, +9 more. Returns: result

user_idle_statusA

Check how many milliseconds the user has been idle and which window currently has foreground focus.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 17 tools

    Disambiguation4/5

    Most tools have crisp, distinct purposes: display_status vs user_idle_status vs list_windows answer different questions, and click vs click_element are clearly separated by coordinate vs cached element ID. The main soft overlaps are launch_app_on_display vs launch_on_isolated_desktop and list_windows vs list_isolated_windows, but the descriptions make the target context (visible vs hidden desktop) explicit enough to pick correctly.

    Naming Consistency4/5

    The dominant pattern is snake_case verb_noun (move_window_to_display, capture_window, inspect_ui, press_keys, fill_form). Two outliers, display_status and user_idle_status, are noun-first and break the verb-first convention, though they remain readable.

    Tool Count4/5

    Seventeen tools is on the heavier side, but the domain genuinely spans four areas (displays, window management, isolated desktops, UI automation/input) and each tool covers a distinct capability. No obvious redundant tools inflate the count.

    Completeness4/5

    The surface covers lifecycle well: enumerate displays/windows, move/launch on target displays, isolated desktop launch and listing, capture, inspect, and the full input set (click, click_element, drag, scroll, type, keys, fill_form). Gaps exist around cleanup/termination (no close_window or kill_process for launched apps) and no explicit clipboard or window-activate tool, but agents can work around these.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to drive Windows desktop automation — opening and interacting with applications, native UI controls, keyboard/mouse input, files, processes, clipboard, and Chrome/Edge browsing via UI Automation and CDP. All actions pass through a safety policy with human approval, emergency stop, and deterministic verification.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to observe and drive Windows desktop applications in the background through UI Automation and Win32 messages, without taking over the user's mouse, keyboard, or foreground window. Every action is read back and verified, and outward actions are held for explicit confirmation.
      6
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to capture and inspect high-resolution Windows desktops, snip and zoom regions, use UIA/OCR perception, and control mouse and keyboard input with closed-loop safety.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI clients to automate Windows desktop applications through protocol-first, background-safe window inspection, screenshots, clicks, typing, scrolling, browser CDP control, batch pipelines, and built-in safety guardrails without hijacking the physical mouse or focus.
      MIT