Antigravity Desktop MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Antigravity Desktop MCP Open Notepad and type a short meeting agenda."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Antigravity Desktop MCP (antigravity-desktop-mcp)
A local stdio Model Context Protocol (MCP) server for Windows 10/11 general desktop automation, adapted from the MIT-licensed LJL454/dsh-computer-use project for Google Antigravity.
Built with universal desktop control (screenshots, region/window capture, mouse/keyboard input, clipboard, Win32 window enumeration/focus, COM UI Automation, multi-step batching) plus an always-on-top physical E-Stop overlay HUD, global interrupt hotkeys, anti-capture exclusion, strict HUD self-protection, monotonic window whitelist ratcheting, and event-driven ~0% idle CPU architecture.
Key Capabilities & Architecture
1. 16 Standard MCP Tools (stdio JSON-RPC 2.0)
Tool | Category | Purpose |
| Vision | Full display / virtual desktop / screen region / specific window ( |
| Batch | Up to 50 sequential steps ( |
| Mouse | Absolute or |
| Mouse | Absolute, |
| Mouse | Smooth multi-point |
| Mouse | Vertical or horizontal scroll at cursor or target coordinates. |
| Keyboard | Unicode typing via |
| Keyboard | Single keys, chords ( |
| Windowing | Enumerate visible/minimized top-level windows (HUD automatically filtered out) or bring |
| Accessibility | Native COM |
| Accessibility | Invoke, |
| Clipboard |
|
| Clipboard | Reliable long/CJK text insertion via clipboard + |
| Launch | Launch |
| Safety | Urgent queue-bypass abort: halts running & queued calls, terminates hung PowerShell workers via 6-step shutdown, and runs independent |
| Safety | Inspect E-Stop/overlay/backend health ( |
2. High-Reliability E-Stop & Operational Safety
Always-On-Top Floating HUD (
EStopOverlay.cs):Compiled to
bin/EStopOverlay.exe(.NET 4 WinForms, Per-Monitor V2 DPI aware,WS_EX_NOACTIVATE+WS_EX_TOPMOST).Features a draggable status badge (
待机/护航中/AI执行中/已急停), prominent redSTOP 急停button, user-only恢复 RESUMEbutton, right-click configuration menu (Escmode, whitelist unlock/clear, reposition), and capture-exclusion badge.Marked with
WDA_EXCLUDEFROMCAPTURE(0x11) at Win32 level so hardware/DWM screen captures do not see the overlay pixels (with automatic reference-countedsuspendVisual/resumeVisualfallback if unsupported).
Three-Layer Instant Abort (
< 1 mswake-up + Clean Input Unwind):Global Low-Level Keyboard Hook (
WH_KEYBOARD_LL): Captures real hardware keystrokes while strictly ignoring synthetic AI inputs (LLKHF_INJECTED | LLKHF_LOWER_IL_INJECTED) soAI-typedEscor hotkeys cannot self-trigger.EscAuto-Arming: In defaultautomode,Escis armed whenever AI mutating steps execute and stays armed for a brief cooldown (1800ms) afterward (configurable in UI toalwaysordisabled).Dedicated
RegisterHotKey:Ctrl + Alt + Pauseworks globally at all times (configurable toCtrl+Alt+BackspaceorCtrl+Shift+Escsafe alternatives).Kernel Named
EventWaitHandle(Local\AgyDesktopCancel_<pid>) + Cancel Flag: Immediately wakes blockedWait-Cancellableloops inside PowerShell without waiting for poll intervals orWait-Conditiontimeouts, aborts queued MCP requests cleanly ([USER_ABORTED]), and if any Win32/UIA call refuses to unwind within budget, kills the worker process and runs standalonebackend/release-input.ps1to release any held modifier/mouse keys.
Un-Bypassable Safety Ratchets:
E-Stop Latch: Once triggered by hardware hotkey or physical STOP click, all mutating MCP tools return
[ESTOP_ACTIVE]until the user physically clicks恢复 RESUMEon the floating HUD. MCP tools cannot clear an E-Stop.Protected HUD Target: Coordinates inside
hud.bounds, the HUDhwnd, and the overlay PID are blocked in Node and PowerShell ([PROTECTED_HUD_TARGET]).Monotonic Window Whitelist: User or
desktop_safety(lock_whitelist)can restrict operations to specific processes / title substrings / HWNDs (e.g., TIA Portal, Factory I/O, or Notepad). Once locked, AI can onlytighten_whitelist— disabling or widening returns[WHITELIST_LOCKED]. Under whitelist mode, OS escape chords (win+*,alt+tab,alt+esc,ctrl+esc,ctrl+shift+esc,win) are rejected ([WHITELIST_OS_SHORTCUT_BLOCKED]).
Near-Zero Idle CPU (Zero Busy-Polling):
Node MCP server awaits blocking
readline/stream events.EStopOverlay.exeruns a native Win32Application.Run()message pump.backend/worker.ps1blocks on$stdin.ReadLine()between calls and usesEventWaitHandle.WaitOne(sliceMs)inside waits.
Related MCP server: desk-mcp
Project Layout
antigravity-desktop-mcp/
├── bin/
│ ├── antigravity-desktop-mcp.js # Production stdio MCP entrypoint
│ └── EStopOverlay.exe # Compiled Win32 floating E-Stop overlay & hotkey daemon
├── native/
│ └── EStopOverlay.cs # C# source for physical HUD, WH_KEYBOARD_LL, RegisterHotKey, WDA_EXCLUDEFROMCAPTURE
├── backend/
│ ├── worker.ps1 # Deterministic modular loader generated by scripts/build-worker.mjs
│ ├── release-input.ps1 # Independent held-key/mouse recovery script
│ └── parts/ # Modular PowerShell worker slices (00-preamble .. 13-main-loop)
├── src/
│ ├── server.js # JSON-RPC 2.0 stdio transport + urgent bypass lane for desktop_stop / desktop_safety
│ ├── tools.js # 16 MCP tool schemas and execution handlers
│ ├── safety.js # E-Stop latch, HUD target guard, monotonic whitelist controller
│ ├── overlay-supervisor.js # Supervises EStopOverlay.exe IPC lifecycle
│ ├── capture-service.js # Magic-byte verified PNG/JPEG delivery, ring buffer cleanup, coordinate envelopes
│ ├── backend/ # PowerShellBackend & 6-step Generation lifecycle supervisor
│ └── internal/ # Core contracts ported & extended from dsh-computer-use
├── scripts/
│ ├── build-native.mjs # Compiles native/EStopOverlay.cs via .NET 4 csc.exe
│ ├── build-worker.mjs # Generates deterministic backend/worker.ps1 loader + SHA-256 manifest (--check supported)
│ └── doctor.mjs # Live environment + overlay + worker health check
└── tests/
├── unit-*.test.mjs # Fast offline unit tests (protocol, safety ratchet, worker build)
└── live-desktop.test.mjs # Live Windows end-to-end verification testsCommands
npm run build # Regenerate backend/worker.ps1 + compile bin/EStopOverlay.exe if needed
npm run check:worker # Verify backend/worker.ps1 matches backend/parts/*.ps1 hashes
npm run doctor # Spawn overlay + worker cleanly and output JSON health report
npm test # Run offline unit tests
npm run test:live # Run live Windows tests (overlay, UIA, PrintWindow, whitelist, E-Stop, stdio cleanup)Antigravity Global MCP Configuration (%USERPROFILE%\.gemini\config\mcp_config.json)
{
"mcpServers": {
"desktop": {
"command": "node",
"args": [
"C:\\path\\to\\antigravity-desktop-mcp\\bin\\antigravity-desktop-mcp.js"
],
"env": {
"AGY_DESKTOP_UI_ENGINE": "com"
}
}
}
}Note: In
productionmode (bin/antigravity-desktop-mcp.js),--allow-ipc-resumeis disabled by default so an E-Stop latch can only be cleared by physically clicking恢复 RESUMEon the floating overlay HUD.
Available Tools
16 toolsdesktop_actionsBDestructive
Execute a sequence of up to 50 desktop actions (click, move, drag, scroll, type, paste, key, clipboard, focus, launch, wait, wait_for, screenshot, state, or UI Automation actions like invoke/set_value/get_text) in a single round trip. Aborts immediately at <1ms latency if user E-Stop triggers.
Inputs: steps (required), clip, scale, format, +15 more.
desktop_clickB
Move to (x, y) and click. Prefer passing from_frame from desktop_screenshot so occlusion/window movement is guarded automatically.
Inputs: x (required), y (required), button, clicks, +6 more.
desktop_clipboardA
Read (get), write (set), or clear the Windows text clipboard.
Inputs: op, text.
desktop_dragB
Press left button and drag smoothly from (from_x, from_y) to (to_x, to_y), along a multi-point path, or continuing from previous drag (from_last / continue_from).
Inputs: path, to_x, to_y, from_x, +9 more.
desktop_keyB
Press or hold a key or key chord (e.g. "enter", "ctrl+s", "alt+f4", "ctrl+shift+p"). Blocked OS-escape chords are rejected under whitelist mode.
Inputs: keys (required), repeat, hold_ms, into_hwnd.
desktop_launchC
Launch a Windows application, executable path, Start Menu display name, URL, or Store app with Electron/Node-injection env vars stripped cleanly, and wait for its window.
Inputs: target (required), cwd, kind, refresh, +3 more.
desktop_moveB
Move the mouse cursor to absolute/frame-projected (x, y) or by relative delta (dx, dy) for hover tooltips or pointer-locked canvases.
Inputs: x, y, dx, dy, +4 more.
desktop_pasteB
Paste long or multi-line Unicode text reliably via clipboard + Ctrl+V, automatically saving & restoring previous clipboard contents (use require_restore: true to refuse if clipboard contains non-text data).
Inputs: text (required), verify, restore, into_hwnd, +1 more.
desktop_safetyA
Inspect physical E-Stop overlay state, hotkey config (Esc mode + combo), window whitelist rules, and backend health, OR lock/tighten the window whitelist (lock_whitelist / tighten_whitelist). AI cannot clear an E-Stop or disable/widen an active whitelist.
Inputs: hwnd, rules, action, process, +1 more.
desktop_screenshotARead-only
Capture the Windows screen, a specific display, a specific window (even overlapped via PrintWindow), a screen/window region, or a foreground-plus-related-windows bundle. Returns the image directly plus physical-pixel coordinate metadata and a frame_id for accurate click/drag/scroll projection.
Inputs: clip, scale, format, region, +12 more.
desktop_scrollC
Scroll vertically or horizontally at (x, y) or current cursor position.
Inputs: direction (required), x, y, clicks, +4 more.
desktop_stopA
URGENT: Immediately abort all running and queued desktop actions, kill hung workers if needed, confirm held keys/mouse buttons are released, and optionally latch the E-Stop.
Inputs: latch, reason.
desktop_typeB
Type Unicode text cleanly using SendInput KEYEVENTF_UNICODE into the active foreground window (use into_hwnd to guard against focus stealing).
Inputs: text (required), delay_ms, into_hwnd.
desktop_uiBRead-only
Inspect a window's UI Automation accessibility tree (with compact [s#.#] control refs for desktop_ui_action, snapshot delta diffing, pattern filtering, and optional focused/selected/document text observation).
Inputs: hwnd, prune, filter, compact, +8 more.
desktop_ui_actionC
Perform a UI Automation action on a control identified by ref (from desktop_ui) or by selector (hwnd, automation_id, name, control_type, class_name, index).
Inputs: action (required), ref, hwnd, name, +13 more.
desktop_windowsB
Enumerate visible Windows application windows (and optionally minimized ones with include_minimized), or bring a window to foreground via focus_hwnd.
Inputs: filter, focus_hwnd, include_minimized.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Most tools have clearly distinct purposes: pointer movement, clicking, dragging, typing, window inspection, UI Automation, clipboard, launch, and safety are separable. The main overlap is desktop_actions, which can batch many of the same operations, and desktop_type versus desktop_paste, though their descriptions clarify the intended distinction.
All tool names use a consistent snake_case convention with the shared desktop_ prefix. The verb/noun structure is predictable throughout, e.g. desktop_move, desktop_click, desktop_screenshot, desktop_ui_action.
The 16 tools are justified by a broad desktop-automation domain covering input, screenshots, windows, UI Automation, clipboard, launch, and safety. The surface is slightly heavy relative to the ideal 3-15 range, but each tool maps to a meaningful capability rather than redundant variants.
Coverage is strong for the core desktop automation lifecycle: inspect, move, click, drag, scroll, type, key, clipboard, UI Automation, launch, stop, and safety. Minor gaps remain around direct right-click/double-click gestures and explicit window management operations like resize, move, minimize, or close, though some may be achievable through UI Automation or batch actions.
Maintenance
Related MCP Connectors
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Eyes and hands on real Windows PCs — observe, click, type via Glasswarp API.
Securely control computers you explicitly pair through files, terminals, processes, screenshots, desktop UI/input, clipboard, browser automation, diagnostics, and document tools.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceDesktop UI automation for AI agents: screenshots, window management, mouse, keyboard, UI Automation tree, OCR. Single Windows x64 binary, no dependencies.3-
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to see and control a Windows desktop through screenshots, built-in OCR, mouse and keyboard input, and accessibility trees read via UI Automation, MSAA and Chrome DevTools Protocol. It also manages windows, virtual desktops and element-level actions such as invoking controls or setting values, running on Node.js with the PowerShell that ships with Windows.8Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to drive native Windows apps and headed browsers inside a hidden child desktop session with its own screen, pointer and keyboard focus. Provides tools for screenshots, mouse/keyboard input, accessibility inspection, UI waits, display changes, Android emulators, application launches and cancellable command jobs, so the user's own desktop stays free.9MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI models to control a local Windows desktop by moving the cursor, clicking, scrolling, typing Unicode text, sending key chords, and capturing screenshots. Runs natively on Windows with minimal latency and no heavy dependencies such as Python, PyAutoGUI, or Docker.119 npm1MIT