dsh-cua is a Windows-oriented computer use MCP server, accompanied by an agent skill. It remains client-neutral and works with any stdio MCP client (such as dsh, Claude Code, Codex, Cursor, Cline, ZCode, etc.), and does not itself depend on dsh.
Purpose and design orientation This project focuses on one core problem: sharing the same machine with a human. Its design principle is "accessibility element operations first, screenshots only as a fallback," and it has a built-in cross-session arbiter: it serializes multiple agents when they share one machine, and yields control when the user is personally using the computer.
Main capabilities The server exposes 19 tools via stdio, all with names prefixed with tool_, consistent with what tools/list returns.
Observation (read-only, callable at any time): tool_skyshot (reads a window as a compact, diffable text tree, three orders of magnitude smaller than a screenshot), tool_element_at_point, tool_read_element, tool_find_elements, tool_capture_window (DPI-aware, cropped to the client area), tool_list_windows / tool_find_window / tool_get_window_rect, tool_list_displays, tool_cursor_position, tool_clipboard_read, tool_coexistence_status.
Element operations (soft-gated: serialized across agents, no physical input injected): tool_element_action / tool_element_action_at, supporting press / set_value / select / toggle / expand / collapse / scroll_into_view / focus, delivered directly to UIA elements, so they do not steal focus and are unaffected by window stacking order.
Other mutating calls (also soft-gated, acquiring only the mutex, not yielding due to human occupancy): tool_type_text (targeted PostMessage, with effect_verified), tool_clipboard_write, tool_open_application. They do not synthesize physical input, so they do not wait for the user to stop operating; however, clipboard writes will destroy the content the user last copied, so you should inform when using them.
Physical input (hard gating: serialized across agents and yields to humans): only two paths share the same cursor and keyboard—the raw_event path of tool_click_at and the global hotkey of tool_send_keys. The gate waits for machine input to be quiet, and if it times out, rejects with user-active rather than competing with the user for the cursor. tool_click_at first tries the element path (ax_press), which does not inject physical input and only acquires the mutex; the method field of the receipt indicates which path was actually taken. Coordinate clicks on image or document surfaces take the raw path, because performing Invoke on a surface cannot locate the selected pixel. When Invoke has been sent but the effect is unconfirmed, effect_verified: null is returned, and you should re-observe before retrying. Before pressing the mouse button, a raw click verifies that the cursor moved successfully, that the cursor reached the requested point, and that the point still belongs to the target window; if any check fails, it returns success: false and action_sent: false, and does not send a mouse button event.
Receipt mechanism Each operation returns a receipt rather than self-reporting success, with fields including action_sent / effect_verified / foreground_changed / user-active / arbiter-busy, distinguishing "the call was accepted" from "the effect has occurred". effect_verified being true means the read-back confirmed the requested state or transition, false means the result does not satisfy the request, and null means the effect is unconfirmed.
Usage Windows x64, an interactive desktop session, and Python ≥3.10 are required to actually drive the desktop. The package can also be installed and started on Linux/macOS, and tools/list responds normally, but actual tool calls return a "requires Windows" error rather than a process startup failure (behavior in 0.3.1 and later; in 0.3.0 the import itself throws an error). After installation, start the server with python -m dsh_cua. The package provides two console scripts, dsh-cua-server and dsh-cua both start the same server; the documentation examples use the explicit form --from dsh-cua dsh-cua-server.
Applicable scenarios and limitations Suitable for targets that have no addressable, scriptable surface of their own, such as File Explorer, native dialogs, Office, canvases and games, and applications without a scripting API—in these scenarios, OS-level input is the only way.
Capabilities explicitly not provided: it does not perform grounding itself (the server does not analyze pixels), so text-only models cannot drive interfaces that a text tree cannot express (canvases, games, remote desktops); when paired with a model that has visual capabilities, the pixel path can be supported end to end—capture_window returns an image and a verified image-to-screen mapping (bounds, scale_x, scale_y, dpi_verified), with grounding provided by the model. When dpi_verified is true, multiply the image coordinates by scale_x and scale_y, then add bounds.x and bounds.y to get screen coordinates. In addition, recording/playback and isolated sandboxes are not provided.
Regarding the second desktop/virtual display: Windows routes input per desktop rather than per monitor, and a desktop has only one input queue and one cursor position, so it is not possible to isolate agent input to a separate screen the way Android's VirtualDisplay does. Actual testing shows that a browser window parked on a second monitor can be read by skyshot without stealing focus, but WM_CHAR delivered to it has no effect when the window is inactive; therefore a second monitor only buys "read" and not "write". For web pages, injecting input through the browser's own protocol (such as CDP) is another viable path, and this project does not compete with it.
Other notes: a small text tree does not equal an empty window; a minimized window may show "no content displayed" rather than "there really is no content", and the receipt reports the minimized state; tool_skyshot and tool_find_elements report that state. tool_element_action_at requires the hwnd, shot_id, and element index from the same tool_skyshot response; a newer observation of that window invalidates the old shot_id, and elements renumbered in the diff are marked with ~; if an element does not appear in the diff, you can take a full snapshot with disable_diff=true and use the index and shot_id it returns. Among the read-only tools, tool_capture_window writes screenshots to disk (save_path, or a temporary file if omitted), and tool_skyshot updates the server-side diff baseline.