desktop-automation
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
desktop-automation
Safety-first, OS-native Windows desktop automation skill & MCP server for AI agents.
Give your AI agent verified mouse control, API-first keyboard input, Windows UI Automation (UIA) semantic element snapshots, numbered Set-of-Mark screenshots, pre-action perception guards, and Recycle Bin–only file safety — without injecting scripts into web pages or relying on fragile visual coordinate guessing.
Works out of the box with Antigravity, Claude Desktop / Claude Code, Cursor, WorkBuddy, or standalone Python scripts. See SKILL.md for the agent-facing rules; this README is for humans setting it up.
Why desktop-automation?
Principle | How it works |
OS-native, zero script injection | Operates real Windows apps and browsers at the OS / UIA accessibility layer ( |
Hybrid UIA + Pixel grounding | Semantic Windows UIA tree + Pillow numbered Set-of-Mark screenshots ( |
Pre-Action Perception Guards |
|
API-first typing & clipboard safety | Prefers |
Zero-dependency MCP server |
|
Hard safety boundaries | Failsafe corner |
Related MCP server: pc-bot
Architecture
Agent Host (Antigravity / Claude / Cursor / WorkBuddy)
│
├── MCP stdio (mcp_server.py — 24 tools, pure stdlib, audit log)
└── CLI / Skill (SKILL.md + references/)
│
├── uia_inspector.py Windows UIA tree, --browser-dom, Set-of-Mark, drift-guarded click
├── ui_detect.py Window activate/probe, pixel verify_region, highlight, grid, wait
├── keyboard_input.py WM_SETTEXT (2s timeout), clipboard fallback, UTF-16LE SendInput, safe hotkey
├── mouse_controller.py Multi-monitor virtual screen, (0,0) failsafe, <=2px landing retry
├── desktop_automation.py doctor, scan (read-only), screenshot, clipboard, sysinfo, safe trash
├── detached_launcher.py GUI process launcher & liveness check (--pid / name)
├── dpi_utils.py Per-Monitor V2 DPI awareness & virtual screen bounds
└── config.py Optional config.json loader, allowed_apps policy, JSONL audit trailRequirements
OS: Windows 10 / 11 (pure logic tests and
mcp_server.pytools/listalso run on Linux/macOS)Python: >= 3.10
Core dependencies (
requirements.txt):pyautogui,pyperclip,Pillow,psutil,openpyxl,watchdog,requests,send2trashOptional extras (
pyproject.toml):uia:uiautomation>=2.0.18(Apache-2.0) — enablesuia_inspector.py(ui_snapshot/ui_click_element)fast-vision:numpy>=1.26.0— vectorized pixel detection inui_detect.py
Install
(a) MCP Server (Antigravity / Claude Desktop / Cursor)
Clone the repository and create a virtual environment:
git clone https://github.com/kingsleyW-png/desktop-automation.git
cd desktop-automation
python -m venv .venv
.venv\Scripts\pip install -r requirements.txt
.venv\Scripts\pip install uiautomation # optional: enables UIA snapshot & browser DOMAdd
desktop-automationto your MCP config (e.g.~/.gemini/config/mcp_config.jsonfor Antigravity,claude_desktop_config.jsonfor Claude Desktop, or Cursor MCP settings — see mcp.example.json):
{
"mcpServers": {
"desktop-automation": {
"command": "C:/path/to/desktop-automation/.venv/Scripts/python.exe",
"args": ["C:/path/to/desktop-automation/mcp_server.py"]
}
}
}(b) WorkBuddy / Skill Host (PowerShell)
From the repository root:
./install.ps1This copies the skill into ~/.workbuddy/skills/desktop-automation/ and creates a .venv inside it. Without -Force it refuses to overwrite an existing install; with -Force it backs up the existing directory first. Pass -TargetDir <path> to install into another skill host (e.g. ~/.claude/skills/desktop-automation).
(c) Environment Self-Check
.venv\Scripts\python desktop_automation.py doctorQuick Start
# 1. Semantic UIA snapshot + browser DOM extraction + Set-of-Mark screenshot
.venv/Scripts/python uia_inspector.py snapshot --window Chrome --browser-dom --annotate shot_som.png
.venv/Scripts/python uia_inspector.py click --window Chrome --id 12 --dry-run
# 2. Mouse control (virtual-screen validated, landing verified <= 2px)
.venv/Scripts/python mouse_controller.py move 100 200 --dry-run
.venv/Scripts/python mouse_controller.py click 100 200
# 3. Keyboard (API direct write first; auto-fallback; safe hotkeys)
.venv/Scripts/python keyboard_input.py api "Notepad" "text to type"
.venv/Scripts/python keyboard_input.py write "My App" "hello" --focus 1100 580
.venv/Scripts/python keyboard_input.py hotkey ctrl l --window Chrome --dry-run
.venv/Scripts/python keyboard_input.py read "Notepad"
# 4. Programmatic UI detection & pre-send check
.venv/Scripts/python ui_detect.py window Notepad
.venv/Scripts/python ui_detect.py activate Notepad
.venv/Scripts/python ui_detect.py check shot.png 878,524,1438,634
.venv/Scripts/python ui_detect.py wait 558,34,1454,682 --timeout 6
# 5. Read-only scan, screenshot, system info, doctor
.venv/Scripts/python desktop_automation.py scan <directory>
.venv/Scripts/python desktop_automation.py screenshot shot.png
.venv/Scripts/python desktop_automation.py sysinfo
.venv/Scripts/python desktop_automation.py doctorConfiguration (config.json)
Copy config.example.json to config.json next to the scripts to customize:
allowed_apps: non-empty allowlist of window title substrings (e.g.["Chrome", "Notepad"]); operations targeting windows outside the list are refused.audit:{"enabled": true, "path": null}enables redacted JSONL action logging (default~/.desktop-automation/audit.jsonl).protected_dirs/trash.batch_limit: customize protected paths and max batch size fortrash.colour_thresholds/verify_region.min_proportion: tune pixel detection for dark themes or other apps.
Safety Rules
Programmatic coordinates only: click targets come from UIA snapshots or programmatic pixel / Win32 data — never visually estimated off a screenshot.
Verify before sending: before any submit/send action, verify window/conversation title and input content (
ui_check); stop if verification fails.Human handoff for auth & challenges: never enter credentials without explicit user approval; logins, 2FA, device verification, and CAPTCHAs are always completed by the user.
Recycle Bin only:
trashrefuses symlinks and directories, requires--yes, caps batches at 10, and protectsDesktop / Downloads / Documentssubtrees plus top-level home files.Blocked dangerous hotkeys:
keyboard_hotkeyblocks OS lock/interrupt combos (Ctrl+Alt+Del,Win+L).
Testing
Unit tests live in tests/ (tests/test_precision.py and tests/test_public.py) and run cleanly on both Windows and Linux:
python -m unittest discover -s tests -vSee TEST_REPORT.md for the end-to-end verification record and CHANGELOG.md for release notes.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote desktop MCP: let AI see, click, type and run terminal commands on your own Windows or Mac.
Let AI see and use your own Windows PC with your permission: screen, apps, mouse and keyboard.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Remote MCP server to control your Android phone from AI assistants with per-app permissions.
Related MCP Servers
- FlicenseBqualityCmaintenanceA local, dependency-free MCP server that gives AI agents controlled access to the active Windows desktop, enabling automated interaction with applications through screenshots, clicks, typing, and window management.81-
- FlicenseNot gradedqualityDmaintenanceMCP server that enables AI agents to control Windows by clicking, typing, and navigating with a visible cursor overlay, using a layered approach (native UIA, browser CDP, pixel fallback) for reliable interaction.1-
- AlicenseNot gradedqualityDmaintenanceA local MCP server that lets multiple AI agents safely share a Windows desktop by coordinating exclusive access to the mouse, keyboard, screen, and windows, with human consent, takeover, and full activity logging.MIT
- AlicenseAqualityBmaintenanceA self-hosted MCP server that enables AI agents to see and control a Windows PC through screenshots, built-in Arabic/English OCR, mouse, keyboard, clipboard, and application launching, with code-enforced consent and audit logging.21MIT