Cua Driver is a background computer-use driver for macOS, Windows, and Linux. It lets AI agents click, type, scroll, and verify inside native desktop applications without stealing focus, moving the user’s cursor, or raising windows to the foreground. This page explains how the driver’s architecture — Rust native runtime, UniFFI language bindings, MCP over stdio, permission modes, and daemon topology — fits together.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/trycua/cua/llms.txt
Use this file to discover all available pages before exploring further.
The typed contract and language bindings
The publicCuaDriver SDK contract is canonical. All language bindings and the MCP server are generated from the same Rust contract:
cua_driver) and TypeScript (@trycua/cua-driver) are generated by UniFFI. The stable native boundary is declared in rust/include/cua_driver_abi.h.
MCP over stdio
Cua Driver speaks MCP (Model Context Protocol) over stdio. Agent harnesses such as Claude Code, Codex, Cursor, and Prime Agent connect to the driver by spawningcua-driver mcp as a child process and exchanging JSON-RPC messages over stdin/stdout.
The standard registration (all platforms):
cua-driver mcp command works with any harness that implements the MCP client side.
The tool catalog
Cua Driver exposes a cross-platform catalog of tools. The core tools available on macOS, Windows, and Linux include:| Tool | Surface | Description |
|---|---|---|
click | Native | Click at coordinates or accessibility element (supports left, right, double-click via button and count parameters) |
drag | Native | Click-drag from one point to another |
type_text | Native | Type text into the focused or targeted control |
press_key | Native | Press a named key or key combination |
hotkey | Native | Send a hotkey (e.g., Cmd+C) |
scroll | Native | Scroll at coordinates |
move_cursor | Native | Move the agent cursor to coordinates |
get_desktop_state | Observation | Capture screenshot and accessibility tree |
get_screen_size | Observation | Current screen dimensions |
get_cursor_position | Observation | Current cursor coordinates |
verify_state | Verification | Assert a condition about current desktop state |
invoke_menu | Native | Invoke a named menu item |
set_window_frame | Native | Resize or reposition a window |
clipboard_read | Clipboard | Read the system clipboard |
clipboard_write | Clipboard | Write to the system clipboard |
start_session | Session | Begin a scoped automation session |
end_session | Session | End a scoped session |
Permission modes
The permission mode belongs to the process that owns the runtime and is fixed at launch. A running daemon must be restarted to change its mode.The default. Admits the full reviewed built-in operation set. No user confirmation is required for individual tool calls. Appropriate for trusted workloads on machines you control.
Narrows the allowed calls to a reviewed manifest. Only tools and resources listed in the manifest are admitted. Use
bounded when you want an agent to work only within a declared scope — for example, only in specific applications or only reading (no clipboard writes).Removes Cua’s runtime restrictions. Requires the explicit flag
--dangerously-bypass-approvals at launch. No managed or user policy ceiling can be widened by this mode — it only removes Cua’s own layer.The no-foreground contract
Cua Driver’s default path operates applications in the background — without raising their windows, moving the real cursor, or switching the user’s active app. This works through platform-specific mechanisms:- macOS: Accessibility API for button presses and value reads without foreground activation; ScreenCaptureKit for window-specific capture without requiring the window to be raised.
- Windows: UI Automation by window handle while another app is active; message posting to target windows.
- Linux: AT-SPI for semantic element actions; X11 window-addressable input and capture on X11/XWayland. On Wayland, synthetic input is constrained by the compositor, so the background path relies more heavily on AT-SPI.
Daemon architecture
Cua Driver supports three execution topologies:| Topology | Description | When to use |
|---|---|---|
| Same process | CuaDriver.create() loads the runtime inside the importing app | Applications embedding Cua Driver directly |
| Private worker | create_private_worker() spawns a supervised child over inherited pipes | Per-host process isolation without a listener |
| Daemon | Long-lived process with stable OS identity | Standalone macOS (CuaDriver.app) or shared service |
CuaDriver.app daemon keeps that identity stable across CLI and agent reconnects. The recommended macOS launch sequence is:
cua-driver mcp now owns its runtime directly in the same process and shuts it down on stdin EOF. There is no automatic discovery or joining of an existing daemon. Use cua-driver mcp --socket <endpoint> when an agent must share a daemon’s sessions and resources.
Security hardening
- The optional loopback HTTP MCP listener is disabled by default. Enable it with
CUA_DRIVER_RS_MCP_HTTP_PORT;CUA_DRIVER_RS_MCP_HTTP_TOKENis also required (32–4096 non-whitespace characters). - Windows daemon named pipes grant access only to the daemon owner’s user SID. Clients running as a different user or security principal are rejected.
- The policy engine hashes each immutable policy snapshot and includes those hashes in authorization-host requests and status output.
Further reading
Drive your first app
Install Cua Driver, connect Claude Code, and drive a real desktop app step by step.
Permission modes reference
Full reference for standard, bounded, and unrestricted modes, including YAML and Rego policy syntax.
Process model
Platform-specific details on process identity, TCC grants, and service topology.
What is computer use?
The broader model behind computer-use automation and where Cua Driver fits.