Skip to main content

Omni-Desktop-MCP

An MCP server that lets an AI agent observe and operate desktop applications efficiently through three stable tools (desktop_observe, desktop_act, desktop_status).

Platform status

Platform Status
Windows 10/11 Implemented and tested (see Testing).
macOS Experimental stub: window listing and screenshots only; input actions return unsupported_on_current_host. Not tested on macOS hardware.
Linux Experimental stub using wmctrl/xdotool when present. Not tested on a Linux desktop.

This is alpha software (0.2.0). It can click, type, and close windows on your machine. Read Safety first.

What is new in v0.2.0

  • 3–4× faster Windows UIA inspection: single-RPC COM IUIAutomation.FindAllBuildCache on a dedicated STA thread (with automatic BFS fallback) plus live COM element handle caching for sub-20 ms background L1 Invoke / Value / Scroll calls. On local testing (Microsoft Edge), COM CacheRequest ran in 130 ms vs 405 ms for Python BFS; on DeepSeek Harness (Electron), 417 ms for 213 elements vs 1538 ms truncated at 78.
  • Background capture without stealing focus: PrintWindow(PW_RENDERFULLCONTENT) reads obscured Windows apps cleanly (with automatic correction for DPI-unaware windows under >100% Windows scaling and black-frame fallback to screen grab).
  • Adaptive dual-engine OCR + frame-hash cache: automatically uses offline RapidOCR (pip install "omni-desktop-mcp[ocr]") when installed and falls back cleanly to zero-dependency WinRT OCR (Chinese + English). Identical frames return from the micro-cache in ~1–2 ms.
  • 50%+ fewer LLM round-trips:
    • observe_after="diff|tree|ocr|hybrid|screenshot" + settle_ms merges post-action observation into desktop_act.
    • action="find_and_act" finds a control by label (UIA first, background OCR fallback) and acts in one call.
    • Parameterized Macro Playbooks (macro_record_start, macro_record_stop, macro_save, macro_run, macro_delete, desktop_status(command="macros")): persist reusable multi-step JSON playbooks under ~/.omni-desktop/macros/ with {{var}} substitution, dry_run preview, and full SafetyGuard enforcement.

Install

# Core (zero-dependency Windows WinRT OCR)
pip install omni-desktop-mcp

# Recommended: include offline high-accuracy RapidOCR (PP-OCR)
pip install "omni-desktop-mcp[ocr]"

Requires Python 3.10+ and mcp 2.x (installed automatically). Windows dependencies (pywin32, uiautomation) are installed automatically on Windows.

Run it directly:

omni-desktop-mcp                                      # stdio
omni-desktop-mcp --http --host 127.0.0.1 --port 8765  # Streamable HTTP

Register with your clients

Preview which config files would change (nothing is written):

omni-desktop-mcp-install

Apply (existing files are backed up to *.bak-<timestamp> first; a file that fails to parse is left alone):

omni-desktop-mcp-install --apply
omni-desktop-mcp-install --apply --only codex,trae

It knows about Antigravity (~/.gemini), Codex (~/.codex/config.toml), and Trae CN, only touches clients whose config directory already exists, and installs the bundled omni-desktop-control skill for DeepSeek Harness, Codex, and Trae CN where a skills directory exists.

Or configure manually using snippets in clients/doubao-mcp.json:

{
  "mcpServers": {
    "omni-desktop": {
      "command": "python",
      "args": ["-m", "omni_desktop_mcp"],
      "env": { "PYTHONIOENCODING": "utf-8" }
    }
  }
}

DeepSeek Harness: the repository root is also a configuration-only DSH bundle (package.json with dsh.bundle, plus cordis.patch.yml) that mounts the server through DSH's built-in MCP client. Run pip install omni-desktop-mcp first; if python on DSH's PATH is not the environment you installed into, set command to the absolute path of that python.exe.

Tools

Keeping the tool surface fixed at 3 tools protects client prompt caches:

  1. desktop_observe(mode, window, diff, max_elements, ocr_lang, ocr_engine, include_image, annotate, background_capture, region)
    • mode: windows, tree, ocr, screenshot, hybrid. If tree finds 0 interactive controls, it automatically adds OCR. Images are capped at 1920×1080.
  2. desktop_act(action, ...)
    • Actions: click, double_click, right_click, move, drag, scroll, type, press_key, hotkey, window_focus, window_state, launch_app, wait_for, find_and_act, batch, macro_record_start, macro_record_stop, macro_save, macro_run, macro_delete.
    • Delivery: auto (L1 background UIA → L2 foreground SendInput → L3 foreground-lock bypass with focus restore), background, or foreground.
    • observe_after: "none" | "diff" | "tree" | "ocr" | "hybrid" | "screenshot" appends post-action state after settle_ms.
  3. desktop_status(command)
    • health, policy, macros, reset_guard, clear_snapshots.

Safety

This is not a sandbox. Anything the logged-in user can do with mouse and keyboard, an agent connected to this server can do.

  • Dangerous hotkeys (Ctrl+Alt+Del, Win+L, Shift+Del, Alt+F4) and closing protected windows (DSH, Explorer, core Windows processes) are refused by default — including inside batch and macro_run — unless allow_dangerous=true is explicitly passed.
  • Holding Esc aborts the current action, drag, batch, or macro at dispatch and between steps. No global mouse hooks are installed (immune to zero-delta wireless mouse WM_MOUSEMOVE lockups).
  • The HTTP transport has no authentication. Keep it bound to 127.0.0.1.
  • Windows UIPI: a non-elevated server cannot drive an elevated window; such actions fail with foreground_unavailable.

Known limitations

  • Without [ocr], the zero-dependency WinRT OCR engine can misread small thin Latin fonts (for example reading CLICKED as CL℃KED). Installing omni-desktop-mcp[ocr] (RapidOCR) resolved this in our live E2E test.
  • Some exclusive DirectX/OpenGL windows return a blank frame from PrintWindow; the backend detects this and falls back to screen capture (which requires the window to be visible on screen).
  • No cross-project accuracy benchmark against other desktop-automation servers has been run; only local timing comparisons between our v0.1 BFS path and v0.2 COM path were measured.

Testing

pip install pytest
pytest -v

12 automated tests cover snapshot diffs, OCR routing & caching, macro CRUD/generalization/safety, safety guardrails, and a live Windows E2E test (tests/test_windows_e2e.py) that launches temporary Tk windows (including an obscured window behind an always-on-top cover window) to verify COM UIA, PrintWindow background capture + DPI correction, RapidOCR accuracy, find_and_act + observe_after, and macro playback.

License

MIT. See LICENSE.

Metadata

Release files for omni-desktop-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omni-desktop-mcp 0.2.0
File Size Uploaded Provenance Actions
omni_desktop_mcp-0.2.0.tar.gz 60.5 kB Without provenance Details for omni_desktop_mcp-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for omni-desktop-mcp 0.2.0
File Interpreter ABI Platform Actions
omni_desktop_mcp-0.2.0-py3-none-any.whl Python 3 none any Details for omni_desktop_mcp-0.2.0-py3-none-any.whl

Total release size: 118.8 kB

Release files / omni_desktop_mcp-0.2.0.tar.gz

Download URL omni_desktop_mcp-0.2.0.tar.gz
Size 60.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1122d87143dac5de3a4ffaf09b1b13e68ea44bdf7661513b82cf3415491e90fa
BLAKE2b-256 checksum
How to use checksums
5b200b9743fbb35f3d4f94d73315c51c7e4499f551f6a08dc228b927426d57e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / omni_desktop_mcp-0.2.0-py3-none-any.whl

Download URL omni_desktop_mcp-0.2.0-py3-none-any.whl
Size 58.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4126806706d539e8e12b2fdc5d373ee43824c3aa3700d4fa182e7fbed0e8aeed
BLAKE2b-256 checksum
How to use checksums
05d0ce17bcce86e4b18c0e6d98e3b407f6330cabf81cfb0222a2c75a5df6497a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for omni-desktop-mcp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page