Click and type

Clicks, typing, keys and shortcuts, element values and the clipboard.

ToolDescriptionPlatforms
clickClick a target pid.macOS, Linux, Windows
double_clickDouble-click at (x, y) or on an AX element identified by element_token.macOS, Linux, Windows
right_clickRight-click against a target pid.macOS, Linux, Windows
type_textInsert text via AXSetAttribute(kAXSelectedText) into the element given by element_token, or the pid's focused element.macOS, Linux, Windows
press_keyPress and release one key.macOS, Linux, Windows
hotkeyPress a key combination: e.g.macOS, Linux, Windows
set_valueSet an element's value by element_token.macOS, Linux, Windows
clipboard_readList available system clipboard types and optionally return privacy-sensitive plain text.macOS, Linux, Windows
clipboard_writeReplace the system clipboard with exactly one value: plain text, an image from an absolute local path, or a file URL from an absolute local path.macOS, Linux, Windows

Served by cua-driver mcp; see MCP tools for every tool.

Click tool#

Click by element or pixel.

click#

Effect: destructive. Platforms: macOS, Linux, Windows.

Click a target pid. Prefer element_token (from get_window_state): it identifies one snapshot element, works on backgrounded, minimized or off-Space windows, and moves no cursor or focus. Use x, y only for canvas / video / WebGL / custom-drawn surfaces missing from the AX tree.

  • element_token: AX action path. Tokens are scoped to (pid, window_id) and stale once the window is snapshotted again.
  • x, y: window-local pixels of the get_window_state screenshot, sent as CGEvent mouse events. Needs a visible window. modifier takes cmd/shift/option/ctrl.

button defaults to left; on the AX path "right" maps to AXShowMenu and "middle" falls back to a pixel click at the element center. action: press (default), show_menu, pick, confirm, cancel, open, show_alternate_ui, show_default_ui; an element listing showalternateui reveals its hover-only controls with show_alternate_ui, in the background and without the pointer. from_zoom:true translates zoom-image pixels after a zoom call. Pressing a popup button opens its menu and leaves it open until an item is chosen or it is dismissed; in the background the user's front window keeps key focus meanwhile. To choose an option in one call use set_value. In the background a web <select> (Chrome, Electron) is not opened, because its menu would raise the browser window: the click is refused with select_menu_would_raise_window; use set_value.

macOS parameters

ParameterTypeDefaultDescription
actionstringAX action: press (default), show_menu, pick, confirm, cancel, open, show_alternate_ui, show_default_ui. show_alternate_ui reveals hover-only controls on an element that lists it, without the pointer.
button"left" | "right" | "middle"Mouse button. Default left.
capture_idstringOptional capture ID from get_window_state or get_desktop_state. With x,y it is consumed atomically; stale or mismatched captures are refused.
countintegerClick count (pixel path only). Default 1.
debug_image_outstringWrite a screenshot with a crosshair at (x, y) to this path. Needs window_id; not with from_zoom.
delivery_mode"background" | "foreground"Default "background" (no fronting). "foreground" briefly fronts the window, acts, then restores the prior app; needs window_id and is required for modified clicks. Escalate in order: AX element_token, background pixel, foreground, checking state between rungs; a click has no read-back except list-row selection.
from_zoombooleanx and y are in the last zoom image for this pid.
modifierstring[]Modifier keys: cmd, shift, option/alt, ctrl.
pidintegerTarget process ID. Optional with element_token (it carries the pid).
scope"window" | "desktop"Default "window". "desktop": x,y with no pid/window_id are true screen pixels from get_desktop_state.
sessionstringFor multi-call work, prefer a short public session label and repeat it on every call that accepts it.
window_idintegerTarget window ID. Omit with element_token.
xnumberX in screenshot pixels (get_window_state PNG, or get_desktop_state PNG for a desktop target).
ynumberY in screenshot pixels from the image selected by target.

Parameters on every platform

ParameterTypeDefaultDescription
element_tokenstringElement handle <snapshot_id>:<row> from get_window_state: row [11] of a read whose snapshot_id is s0000002a is "s0000002a:11" (also in structuredContent.elements[].element_token). Returns an explicit stale error naming the current snapshots once a newer read supersedes it.
targetobjectExact window (kind "window", with pid and window_id) or desktop (kind "desktop", with display_id). "primary" is the portable desktop target.
target.display_idstringDisplay id. Required when kind is desktop; use "primary".
target.kind"window" | "desktop"window requires pid and window_id; desktop requires display_id.
target.pidintegerProcess id. Required when kind is window. Minimum: 0.
target.window_idintegerWindow id from list_windows. Required when kind is window. Minimum: 0.

Double-click and right-click tools#

Double-click and right-click by element or pixel.

double_click#

Effect: destructive. Platforms: macOS, Linux, Windows.

Double-click at (x, y) or on an AX element identified by element_token.

AX path (element_token provided): performs AXOpen when the element advertises it (Finder items, openable list rows/cells); otherwise resolves the element's on-screen center and falls back to a pixel double-click there.

Pixel path (x, y provided): two down/up pairs ~80 ms apart at the given coordinates.

macOS parameters

ParameterTypeDefaultDescription
delivery_mode"background" | "foreground"Best-effort-background ladder rung (default "background"). "background": inject without fronting or raising the target; no focus steal. "foreground": briefly front the target, act, then restore the prior frontmost; the explicit last resort when a background attempt didn't land. Re-call with "foreground" only for the action that needs it.
window_idintegerCGWindowID. Omit when element_token is supplied (the token carries it).
xnumberScreen X coordinate (pixel path).
ynumberScreen Y coordinate (pixel path).

Parameters on every platform

ParameterTypeDefaultDescription
element_tokenstringElement handle <snapshot_id>:<row> from get_window_state: row [11] of a read whose snapshot_id is s0000002a is "s0000002a:11" (also in structuredContent.elements[].element_token). Returns an explicit stale error naming the current snapshots once a newer read supersedes it.
pidintegerTarget process ID. Optional with element_token (the token carries the pid).
sessionstringFor multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session.

right_click#

Effect: destructive. Platforms: macOS, Linux, Windows.

Right-click against a target pid. Two addressing modes:

  • element_token (from the last get_window_state snapshot): performs AXShowMenu on the cached element. Pure AX RPC, works on backgrounded / hidden windows, no cursor move or focus steal. Requires a prior get_window_state(pid, window_id) in this turn.

  • x, y: synthesizes rightMouseDown / rightMouseUp CGEvent pair posted to the pid. Driver converts image-pixel → screen-point internally. modifier forces the CGEvent path (AX actions don't propagate modifier keys).

Exactly one of element_token or (x AND y) must be provided. pid is required with x, y; an element_token carries its own pid.

macOS parameters

ParameterTypeDefaultDescription
delivery_mode"background" | "foreground"Best-effort-background ladder rung (default "background"). "background": inject without fronting or raising the target; no focus steal. "foreground": briefly front the target, act, then restore the prior frontmost; the explicit last resort when a background attempt didn't land. Re-call with "foreground" only for the action that needs it.
modifierstring[]Modifier keys held during the right-click: cmd/shift/option/ctrl. Pixel path only.
window_idintegerCGWindowID. Omit when element_token is supplied (the token carries it).
xnumberX in window-local screenshot pixels. Must be provided together with y.
ynumberY in window-local screenshot pixels. Must be provided together with x.

Parameters on every platform

ParameterTypeDefaultDescription
element_tokenstringElement handle <snapshot_id>:<row> from get_window_state: row [11] of a read whose snapshot_id is s0000002a is "s0000002a:11" (also in structuredContent.elements[].element_token). Returns an explicit stale error naming the current snapshots once a newer read supersedes it.
pidintegerTarget process ID. Optional with element_token (the token carries the pid).
sessionstringFor multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session.

Typing tools#

Type text into a field or window.

type_text#

Effect: destructive. Platforms: macOS, Linux, Windows.

Insert text via AXSetAttribute(kAXSelectedText) into the element given by element_token, or the pid's focused element. Does not press keys: use press_key / hotkey for Return, Escape, arrows. If AX insertion is unsupported (Chromium/Electron), it falls back to CGEvent typing when the route fits the transport budget; longer routes are refused with a safe chunk size.

Web content (browser tabs, Slack, VS Code): AXValue is not proof the DOM saw the text, so the result is effect:"unverifiable" and Electron web content refuses background delivery. For a browser tab use the page tool. For an embedded web view pass x, y (no element_token) to pixel-click the field then type in one call; a pixel click will not reliably open a closed control, so AX-press it open first. Confirm from the screenshot, and use delivery_mode:"foreground" only if background still drops the text.

macOS parameters

ParameterTypeDefaultDescription
delay_msintegerMs between characters in the CGEvent fallback. Default 30. Range: 0 to 200.
delivery_mode"background" | "foreground"Default "background": AX insert, then CGEvent keys, no focus steal. "foreground": front the window, type, restore; last resort for surfaces (WhatsApp/Catalyst) where background keys do not land.
element_tokenstringElement handle <snapshot_id>:<row> from get_window_state: row [11] of a read whose snapshot_id is s0000002a is "s0000002a:11" (also in structuredContent.elements[].element_token). Returns an explicit stale error naming the current snapshots once a newer read supersedes it.
pidintegerTarget process ID.
scope"window" | "desktop""window""desktop" with no pid/window_id types into the frontmost app.
sessionstringFor multi-call work, prefer a short public session label and repeat it on every call that accepts it.
textstringrequiredText to insert.
window_idintegerWindow ID. Omit with element_token.
xnumberScreenshot-pixel X of the field (get_window_state PNG, as in click). With y and no element_token, pixel-clicks to focus, then types.
ynumberScreenshot-pixel Y (see x).

Parameters on every platform

ParameterTypeDefaultDescription
targetobjectPreferred per-call target: an exact window (kind="window", pid, window_id) or the primary desktop (kind="desktop", display_id="primary").
target.display_idstringDisplay id. Required when kind is desktop; use "primary".
target.kind"window" | "desktop"window requires pid and window_id; desktop requires display_id.
target.pidintegerProcess id. Required when kind is window. Minimum: 0.
target.window_idintegerWindow id from list_windows. Required when kind is window. Minimum: 0.

Example arguments

{"text":"<text>"}

Key and shortcut tools#

Press keys and keyboard shortcuts.

press_key#

Effect: destructive. Platforms: macOS, Linux, Windows.

Press and release one key. delivery_mode as in click/type_text.

  • background (default): posts to the pid without raising the window; with element_token it focuses that element first.
  • foreground: fronts the exact window (needs window_id), sends a real HID key transition (Chromium content, inline editors, menu equivalents), then restores the prior app.

An element target whose focus cannot be confirmed is refused with target_focus_unconfirmed, effect "refused", and no key dispatched. Confirmed only when a native AX value/selection read-back changes; otherwise effect:"unverifiable" (not a delivery failure). Keys: return, tab, escape, up/down/left/right, space, delete, home, end, pageup, pagedown, f1-f12, any letter or digit.

macOS parameters

ParameterTypeDefaultDescription
delivery_mode"background" | "foreground"Default "background": no fronting or focus steal. "foreground": briefly front the window, act, restore the prior app; last resort when background did not land.
keystringrequiredKey name.
modifiersstring[]cmd, shift, option/alt, ctrl, fn.
pidintegerTarget process ID.
scope"window" | "desktop""window""desktop" with no pid/window_id sends to the frontmost app.
sessionstringFor multi-call work, prefer a short public session label and repeat it on every call that accepts it.
window_idintegerTarget window; required for foreground. Does not raise by itself.
xnumberScreenshot-pixel X: pixel-click to focus, then send the key. With y, no element_token.
ynumberScreenshot-pixel Y (see x).

Parameters on every platform

ParameterTypeDefaultDescription
element_tokenstringElement handle <snapshot_id>:<row> from get_window_state: row [11] of a read whose snapshot_id is s0000002a is "s0000002a:11" (also in structuredContent.elements[].element_token). Returns an explicit stale error naming the current snapshots once a newer read supersedes it.
targetobjectPreferred per-call target: an exact window (kind="window", pid, window_id) or the primary desktop (kind="desktop", display_id="primary").
target.display_idstringDisplay id. Required when kind is desktop; use "primary".
target.kind"window" | "desktop"window requires pid and window_id; desktop requires display_id.
target.pidintegerProcess id. Required when kind is window. Minimum: 0.
target.window_idintegerWindow id from list_windows. Required when kind is window. Minimum: 0.

Example arguments

{"key":"<key>"}

hotkey#

Effect: destructive. Platforms: macOS, Linux, Windows.

Press a key combination: e.g. ["cmd", "c"] for Copy, ["cmd", "shift", "4"] for screenshot selection. Follows the same delivery_mode ladder as click/type_text: it does NOT raise the window by default: • background (default): post the combo to the target pid WITHOUT fronting or raising it; uses the macOS 14+ auth-message envelope so Chromium/Electron accept it as trusted live input. With an AX target, focus that exact element first. No top-level focus steal. window_id here only targets the combo; it does not raise. Background key events never reach a native app's menus, so when the combo is a menu item's key equivalent (cmd+s, cmd+w, ...) and the app is not in front, that menu item runs through accessibility instead (a disabled Save is saved through the app's scripting interface and verified on disk); a menu item macOS keeps disabled in the background is refused with background_unavailable, and no keys are sent. • foreground: briefly front the window (NSMenu path, < 1 ms via SLPSSetFrontProcessWithOptions) so native menu key-equivalents (Cmd+Z, Cmd+W) dispatch, then restore the prior frontmost; the explicit escalation for menu-bar shortcuts on non-Chromium apps that ignore a background combo. With an AX target or x,y, the focused field receives the chord through the foreground HID queue (needed by native Chromium fields such as the omnibox). Requires window_id.

A combo is never driver-verifiable (no read-back) → effect:"unverifiable"; confirm via screenshot. NOTE: a keyboard combo does NOT focus a text field; to type into a backgrounded Electron input, establish real renderer focus with a PIXEL click first, then type_text. If an app only accepts paste, call clipboard_write, then clipboard_read and verify its types (and text when applicable) before selecting or replacing editor content; only then send Cmd+V.

Recognized modifiers: cmd/command, shift, option/alt, ctrl/control, fn. Non-modifier keys use the same vocabulary as press_key. Order: modifiers first, one non-modifier last.

macOS parameters

ParameterTypeDefaultDescription
delivery_mode"background" | "foreground"Best-effort-background ladder rung (default "background"). "background": inject without fronting or raising the target; no focus steal. "foreground": briefly front the target, act, then restore the prior frontmost; the explicit last resort when a background attempt didn't land. Re-call with "foreground" only for the action that needs it.
keysstring[]requiredModifier(s) and one non-modifier key, e.g. ["cmd", "c"]. Items: 2 to any.
pidintegerTarget process ID. Required with x, y; optional with element_token (the token carries the pid).
scope"window" | "desktop""window"Use desktop with no pid/window_id to send the chord to the frontmost application.
window_idintegerTarget window. Required for delivery_mode:"foreground" (the NSMenu activation needs a window). Does NOT itself raise the window: raising is gated on delivery_mode.
xnumberScreenshot-pixel X: the element px action form: pixel-click there to focus, then send the combo (so e.g. Cmd+V pastes into that field). Pass with y. Use for Chromium/Electron surfaces the background combo can't reach.
ynumberScreenshot-pixel Y (see x).

Parameters on every platform

ParameterTypeDefaultDescription
element_tokenstringElement handle <snapshot_id>:<row> from get_window_state: row [11] of a read whose snapshot_id is s0000002a is "s0000002a:11" (also in structuredContent.elements[].element_token). Returns an explicit stale error naming the current snapshots once a newer read supersedes it.
sessionstringFor multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session.
targetobjectPreferred per-call target: an exact window (kind="window", pid, window_id) or the primary desktop (kind="desktop", display_id="primary").
target.display_idstringDisplay id. Required when kind is desktop; use "primary".
target.kind"window" | "desktop"window requires pid and window_id; desktop requires display_id.
target.pidintegerProcess id. Required when kind is window. Minimum: 0.
target.window_idintegerWindow id from list_windows. Required when kind is window. Minimum: 0.

Example arguments

{"keys":["<key>","<key>"]}

Value and clipboard tools#

Set element values and read or write the clipboard.

set_value#

Effect: destructive, idempotent. Platforms: macOS, Linux, Windows.

Set an element's value by element_token. A popup button / select dropdown: selects the menu item whose title or value matches value (case-insensitive). Safari <select> is set through the DOM; AppKit and Chromium popups list items only while open, so the menu is opened, the item pressed and the menu closed again (in the background the user's front window keeps key focus). An unknown value lists the options. Any other element: writes AXValue (sliders, steppers, date pickers, native text fields).

A Finder file name cell (list or icon view, not being edited) is renamed through Finder's scripting interface with Finder left in the background, and the new name is read back from disk; the value is the full new name with its extension. macOS asks the user once to allow Cua Driver to control Finder. Finder's Get Info Name field is refused with file_name_needs_rename. For free-form text in web inputs use type_text_chars: WebKit ignores AXValue writes.

macOS parameters

ParameterTypeDefaultDescription
sessionstringFor multi-call work, prefer a short public session label and repeat it on every call that accepts it.
valuestringrequiredNew value, coerced to the element's type.
window_idintegerWindow ID. Omit with element_token.

Parameters on every platform

ParameterTypeDefaultDescription
element_tokenstringElement handle <snapshot_id>:<row> from get_window_state: row [11] of a read whose snapshot_id is s0000002a is "s0000002a:11" (also in structuredContent.elements[].element_token). Returns an explicit stale error naming the current snapshots once a newer read supersedes it.
pidintegerTarget process ID. Optional with element_token (the token carries the pid).

Example arguments

{"value":"<value>"}

clipboard_read#

List available system clipboard types and optionally return privacy-sensitive plain text. Clipboard content is never retained in telemetry.

Effect: read-only. Platforms: macOS, Linux, Windows.

ParameterTypeDefaultDescription
include_textbooleanfalseReturn plain-text clipboard content in addition to the available types. Clipboard content is privacy-sensitive and is never retained in telemetry.
sessionstringFor multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session.

clipboard_write#

Replace the system clipboard with exactly one value: plain text, an image from an absolute local path, or a file URL from an absolute local path. Returns the available types for read-back before paste.

Effect: destructive, idempotent. Platforms: macOS, Linux, Windows.

ParameterTypeDefaultDescription
file_pathstringAbsolute path to a local file to place on the clipboard as a file URL.
image_pathstringAbsolute path to a local image to place on the clipboard.
sessionstringFor multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session.
textstringPlain text to place on the clipboard.