Omni-Desktop-MCP
An MCP server that lets an AI agent observe and operate desktop applications through three stable tools.
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/xdotoolwhen present. Not tested on a Linux desktop.This is alpha software (0.1.0). It can click, type, and close windows on your machine. Read Safety first.
What it does
- Three tools (a small, fixed tool list keeps prompts and caches stable):
desktop_observe,desktop_act,desktop_status. - Compact UI Automation tree with one line per interactive control, plus
diff=trueto return only added (+), changed (~), and removed (-) controls since the last observation of that window. - OCR on Windows through the built-in WinRT OCR engine (Chinese and English language packs, whichever are installed), mapped back to screen coordinates, as a fallback for UIs that expose no accessibility tree.
- Background-first input:
desktop_acttries UIA patterns (Invoke, Value, Toggle, SelectionItem, ExpandCollapse, Scroll) first, which move no cursor and change no focus. If that is unavailable it falls back to foregroundSendInput, then to a foreground-lock workaround, and restores the previous foreground window by default. - Unicode-safe typing: UIA ValuePattern with read-back verification, otherwise Unicode
SendInput, or a clipboard paste that restores the previous clipboard text. - Guardrails: stale-snapshot rejection, a 5 s repeat suppressor, a blocklist of dangerous hotkeys, and protection against closing system and harness windows.
Install
pip install omni-desktop-mcp
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 also installs the bundled usage skill for DeepSeek Harness, Codex, and Trae CN where a skills directory exists.
Or add it by hand. Generic snippets are in clients/doubao-mcp.json, for example:
{
"mcpServers": {
"omni-desktop": {
"command": "python",
"args": ["-m", "omni_desktop_mcp"],
"env": { "PYTHONIOENCODING": "utf-8" }
}
}
}
If python on your PATH is not the one you installed into, use the absolute path to that python.exe.
DeepSeek Harness can mount it as a configuration-only bundle using its built-in MCP client:
- insert:
- id: omni-desktop-mcp
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: desktop
transport: stdio
command: C:\path\to\python.exe
args: [-m, omni_desktop_mcp]
env: { PYTHONIOENCODING: utf-8 }
toolCallTimeoutMs: 120000
startupTimeoutMs: 25000
failOnStartupError: false
Tools
desktop_observe(mode, window, diff, max_elements, ocr_lang, include_image, annotate, region):modeiswindows,tree,ocr,screenshot, orhybrid. Iftreefinds no interactive controls it automatically adds OCR. Images are capped at 1920x1080.desktop_act(action, target, window, snapshot_id, delivery, ...):click,double_click,right_click,move,drag,scroll,type,press_key,hotkey,window_focus,window_state,launch_app,wait_for,batch.targetis a ref such asw1:e3/w1:o2from the latest observation, or{x, y}in physical screen pixels.desktop_status(command):health,policy,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 are refused unlessallow_dangerous=trueis passed. Treat that flag as something a human grants, not something an agent decides. - Holding
Escaborts the current action; the key is polled at dispatch and between batch/drag steps, not inside a single OS call. No global input hooks are installed. - The HTTP transport has no authentication. Keep it on
127.0.0.1. Do not expose it to a network. - Windows UIPI: a non-elevated server cannot drive an elevated window; such actions fail with
foreground_unavailablerather than reporting success. - Screenshots and OCR text can contain secrets that are on screen. They are returned to the connected client.
Known limitations
- OCR is imperfect (for example
CLICKEDwas read asCL℃KEDin our own test). Do not rely on a single exact OCR string to confirm an action. - Coordinates are physical screen pixels. The process declares Per-Monitor DPI v2 awareness; behaviour on unusual multi-monitor layouts has only been checked on one two-monitor machine.
- UIA tree walks are time-limited (2 s) and breadth-first with a node cap, so very large trees come back truncated and flagged.
- No latency or accuracy benchmarks against other desktop-automation servers have been run, so none are claimed.
Testing
pip install pytest
pytest
The unit tests cover snapshot diffing, stale refs, and the safety guard. tests/test_windows_e2e.py launches a temporary Tk window and drives it through observe, type, OCR, click, and screenshot; it needs an interactive Windows desktop and will briefly take foreground focus.
License
MIT. See LICENSE.
Metadata
Release files for omni-desktop-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| omni_desktop_mcp-0.1.0.tar.gz | 43.4 kB | Without provenance | Details for omni_desktop_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| omni_desktop_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for omni_desktop_mcp-0.1.0-py3-none-any.whl |
Total release size: 86.4 kB
Release files / omni_desktop_mcp-0.1.0.tar.gz
| Download URL | omni_desktop_mcp-0.1.0.tar.gz |
|---|---|
| Size | 43.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bde963401819bec8542fd958b36e76bd54bd0b6af5f6924eb1d750288035b560
|
|
BLAKE2b-256 checksum How to use checksums |
8afad19c366a4584c2b02dea59f944d9f49503f6a7934a42b8b1185126f850a6
|
| 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.1.0-py3-none-any.whl
| Download URL | omni_desktop_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 43.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
38f9efd3ef65d4ff1da0e39d0b171a590b8eeca30bc05bc3556809a67e119b04
|
|
BLAKE2b-256 checksum How to use checksums |
8825d42b8531b14f2da719a4e78b7d4457283902971760c02830fcbecef21c96
|
| 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.1.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.