Most desktop computer-use agents work by taking a full screenshot after every click. On a 1280x720 desktop capture, one image costs 1,229 input tokens under Anthropic's width * height / 750 formula. A 6-step form fill burns 7,374 vision tokens before the model writes a single word.
I just released turbo-desktop-mcp v0.1.0 on PyPI (uvx turbo-desktop-mcp), a standalone Windows 10/11 MCP server that drives native desktop apps through Windows UI Automation (UIA) first and only falls back to real input or Windows OCR when a control has no UIA pattern.
GitHub: https://github.com/Tthanh2k6/turbo-desktop
PyPI: https://pypi.org/project/turbo-desktop-mcp/
How the control tree and deltas work
Instead of returning raw XML or PNGs, inspect_compact flattens a window into one line per interactive control:
<<<SCREEN_CONTENT w1 TurboFixture>>>
[w1:e1] <Edit> "Full name" = ""
[w1:e2] <ComboBox> "Country" = "Vietnam"
[w1:e3] <CheckBox> "I agree to terms" [unchecked]
[w1:e4] <Button> "Submit"
<<<END_SCREEN_CONTENT>>>
Refs stay stable across calls. On subsequent calls, onlyChanged=true returns only added (*), changed (~), and removed (-) lines. Multi-step sequences run inside batch_actions and stop on the first error.
When an app exposes no UIA tree (custom-drawn canvases, games), inspect_compact sets treeEmpty: true and runs Windows built-in WinRT OCR, returning clickable lines like [w1:o3] text "Save" @412,230.
Measured numbers: UIA deltas vs screenshots
I ran a reproducible 4-task benchmark (desktop-mcp/tests/field/bench_uia_vs_screenshot.py) on Windows 11 against three native C# WinForms fixtures (turbo_fixture.exe, turbo_editor.exe, turbo_canvas.exe). UIA text tokens were counted with tiktoken (o200k_base). Screenshot baselines captured real PNGs on the same windows and measured both exact window crops (460x420 to 620x440) and standard 1280x720 desktop captures.
| Task | turbo-desktop-mcp (UIA + delta) | Window-crop PNGs | 1280x720 desktop PNGs | Payload bytes (UIA vs PNG) |
|---|---|---|---|---|
| 1. WinForms form fill (3 fields + Submit + verify) | 760 tok (4 calls) | 1,548 tok (6 shots) | 7,374 tok | 2.1 KB vs 55.2 KB |
| 2. 5-step stateful UI loop (click + delta diff) | 862 tok (12 calls) | 1,548 tok (6 shots) | 7,374 tok | 2.5 KB vs 40.5 KB |
| 3. Native editor multi-line Unicode write + readback | 456 tok (4 calls) | 1,092 tok (3 shots) | 3,687 tok | 1.3 KB vs 17.4 KB |
| 4. Custom-drawn canvas (empty UIA tree, WinRT OCR) | 235 tok (2 calls) | 125 tok (1 shot) | 1,229 tok | 0.7 KB vs 3.4 KB |
| Total (4 tasks) | 2,313 tok | 4,313 tok | 19,664 tok | 6.5 KB vs 116.4 KB |
Two honest takeaways from that table:
- On standard WinForms controls (tasks 1 to 3), UIA + deltas cut token usage by 8.1x to 9.7x compared to 720p full-desktop captures, and by 1.8x to 2.4x even against tiny tightly cropped fixture windows.
- On Task 4 (
360x260custom canvas with no UIA tree), a cropped PNG (125 tokens) is smaller than the WinRT OCR text output (235 tokens). OCR still helps if you want clickable coordinates without passing images to a vision model, or if the full screen is large.
In an earlier 30-task field run with claude -p --model haiku driving the real MCP server, 29 of 30 tasks passed (173 calls, 203 turns, $0.2513 total). The single failure was UWP Calculator on an isolated exebox desktop where Windows forces UWP activation onto WinSta0\Default.
Things that broke on real Windows before v0.1.0
Three Windows quirks bit me during testing:
-
WinForms modal dialogs hang UIA
Invoke. Calling UIAInvokeon a WinForms menu item likeFile -> Save As...blocks the UIA call until the modal dialog closes.turbo-desktop-mcpreturnspending: true/blocked: trueinstead of hanging, and recommends sendingpress_keys(Ctrl+S) whenever a shortcut exists. -
UIPI blocks input to elevated windows. If a normal-privilege server tries to click an admin window, Windows drops the input silently.
turbo-desktop-mcpchecks process elevation against its own token (is_elevated_above_us) and marks those windowselevated: true, actionable: false. -
Sharing a live PC with an agent. When falling back to real mouse/keyboard input,
turbo-desktop-mcpwaits until you stop moving the mouse, holds a low-level hook (WH_KEYBOARD_LL/WH_MOUSE_LL) during the action, draws an orange edge glow around the monitor, and releases immediately onEscx3 or emergencyCtrl+Alt+Shift+K. Windows with titles matching.env,secret,token,password, or password managers are always hidden and denied.
Quick start (Windows 10/11, Python 3.12+)
claude mcp add turbo-desktop -e PYTHONUTF8=1 -- uvx turbo-desktop-mcp
Or install directly:
pip install turbo-desktop-mcp
The standalone MCP server (desktop-mcp) is MIT-licensed and has 245+ automated Windows tests running on GitHub Actions. If you test it against Electron, WPF, or Qt apps and hit weird UIA trees, open an issue on the repo.
Top comments (5)
The 1,229 tokens for 1280x720 checks out with width*height/750. It changes once windows get big. Past 1568px on the long edge for older Claude models, or 2576px on Claude 4.7 and later, the image gets resized first, so the token count stays capped but small text is gone. slimsnap.ai/blog/screenshot-downscaling measured the same tree vs image trade on web pages and it flips on tall pages: 1,062 vs 1,624 tokens for one screen, but 11,372 vs 448 for a tall page. Did the custom canvas case get worse on bigger windows too?
Yes, it got noticeably worse on 1440p and maximized Electron/canvas windows. Once the model downscales a wide screenshot, 11px toolbar labels blur out and coordinate clicks drift by 10-20px. On those windows we fall back to WinRT OCR on a cropped region around the target pane instead of sending the whole frame.
Interesting, the click drift fits the resize math. On older models a 2560x1440 frame goes down to 1568x882, so an 11px label lands around 6.7px and every click needs scaling back by 1.63. On Claude 4.7 the same frame fits exactly (92x52 tiles = 4,784 tokens), so it should arrive untouched. Did the blur show up on 4.7 too, or only on the older models?
On 4.7 the native 1440p frame is much sharper and readable, so the blur itself goes away, though sending 4,784 tokens per step still adds up fast on a 10-step desktop flow. We keep UIA deltas as default and use cropped WinRT OCR only for custom canvas panes where the tree is empty.
Makes sense, 10 steps at 4,784 is about 48k tokens just for pixels. UIA deltas by default with OCR only for the empty-tree panes sounds like the right split.