Pointer, cursor and browser
Drag, scroll and move the pointer; the agent cursor; web pages and browser input.
| Tool | Description | Platforms |
|---|---|---|
drag | Press-drag-release gesture from (from_x, from_y) to (to_x, to_y) in window-local screenshot pixels: the same space get_window_state returns. | macOS, Linux, Windows |
scroll | Scroll the target pid. | macOS, Linux, Windows |
move_cursor | Move a cursor to (x, y). | macOS, Linux, Windows |
mouse_button_down | Press and hold a mouse button at (x,y) via background X11 delivery. | Linux |
mouse_button_up | Release a previously-held mouse button via background X11 delivery. | Linux |
mouse_drag | Move a previously-held mouse button to a new point via background X11 delivery. | Linux |
parallel_mouse_drag | Run multiple mouse drag gestures concurrently via Linux MPX/XI2 virtual master pointers. | Linux |
set_agent_cursor_enabled | Show or hide the agent cursor owned by a session. | macOS, Linux, Windows |
set_agent_cursor_motion | Configure the movement style, timing, effects and visibility timing for a session cursor. | macOS, Linux, Windows |
set_agent_cursor_theme | Select an already-installed cursor theme for a session. | macOS, Linux, Windows |
get_agent_cursor_state | Return the session cursor's theme, semantic playback, position, visibility, and motion. | macOS, Linux, Windows |
page | Legacy browser compatibility tool. | macOS, Linux, Windows |
get_browser_state | Read-only browser inspection. | macOS, Linux, Windows |
browser_prepare | Attach the browser tools to a browser. | macOS, Linux, Windows |
browser_navigate | Navigate one tab of an exactly-bound browser target to a new URL (http/https/about only). | macOS, Linux, Windows |
browser_click | Click a page element (by ref) or viewport coordinates in an exactly-bound tab. | macOS, Linux, Windows |
browser_type | Type text into an exactly-bound tab via the Input domain. | macOS, Linux, Windows |
browser_select | Select one option of a native HTML <select> ref on an exactly-bound tab without opening its popup. | macOS, Linux, Windows |
browser_pointer | Perform hover, right-click, double-click, scroll, or drag in an exactly-bound browser tab. | macOS, Linux, Windows |
browser_dialog | Inspect or resolve a page-owned JavaScript alert, confirm, prompt, or beforeunload dialog on one exactly-bound tab. | macOS, Linux, Windows |
browser_set_input_files | Assign one or more explicit absolute local files to an exact live <input type=file> ref through CDP. | macOS, Linux, Windows |
browser_download | Trigger one download through an exact live browser ref and save it inside an explicitly approved directory. | macOS, Linux, Windows |
Served by cua-driver mcp; see MCP tools for every tool.
Pointer tools#
Drag, scroll, move the pointer, and press or release buttons.
drag#
Effect: destructive. Platforms: macOS, Linux, Windows.
Press-drag-release gesture from (from_x, from_y) to (to_x, to_y) in window-local screenshot pixels: the same space get_window_state returns. Top-left origin of the target's window.
Use for: marquee/lasso selection, drag-and-drop, resizing via a handle, scrubbing a slider, repositioning a panel.
duration_ms (default 500) is the wall-clock budget for the path between mouse-down and mouse-up; steps (default 20) is the number of intermediate mouseDragged events linearly interpolated along the path. Increase both for slower, more human drags; decrease for snap gestures.
modifier keys (cmd/shift/option/ctrl) are held across the entire gesture.
When from_zoom is true, coordinates are in the last zoom image for this pid; the driver maps them back to window coordinates before dispatching.
A window-scoped drag (pid + window_id) runs in the background by default: the gesture is posted to that window, the real pointer does not move, and the user's frontmost window keeps focus. It works for controls that follow the drag events: sliders, canvases, and pointer-event widgets on web pages in Chrome. In an Electron window the driver sends the gesture from the app's main process, so pointer-capture widgets and HTML5 drag and drop also drop there. Elsewhere, a drag that starts a macOS drag-and-drop session (reordering a list by drag and drop, moving a file, HTML5 draggable content) cannot drop in the background, because macOS tracks those with the real pointer; the driver detects it, releases at once and returns background_unavailable with reason drag_and_drop_session. For a page in a browser tab already bound with get_browser_state, browser_pointer action:"drag" drives the same gesture through CDP with page refs. The result is not driver-verified: confirm with a screenshot or the accessibility tree, and only if nothing changed retry with delivery_mode:"foreground", which briefly fronts the window and moves the physical pointer. Limits and fallbacks: get_guide({topic:"drag"}).
macOS parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
button | "left" | "right" | "middle" | Mouse button used for the drag. Default: left. | |
delivery_mode | "background" | "foreground" | Window-scoped drag on macOS: "background" (default) posts the press, drag and release to the exact window (window_id required) without moving the pointer, raising the window or taking the user's focus. "foreground" briefly fronts the window, drives the physical pointer through the gesture, then restores the prior frontmost app; use it only when a background drag had no effect. Desktop scope ignores this field. | |
duration_ms | integer | Wall-clock duration of the drag path between mouseDown and mouseUp. Default: 500. Range: 0 to 10000. | |
from_x | number | required | Drag-start X in window-local screenshot pixels. Top-left origin. |
from_y | number | required | Drag-start Y in window-local screenshot pixels. Top-left origin. |
from_zoom | boolean | When true, coordinates are in the last zoom image for this pid; driver maps back to window coordinates. | |
modifier | string[] | Modifier keys held across the entire gesture: cmd/shift/option/ctrl. | |
pid | integer | Target process ID. | |
scope | "window" | "desktop" | "window" | Use desktop with no pid/window_id for native get_desktop_state screenshot coordinates. |
steps | integer | Number of intermediate mouseDragged events linearly interpolated along the path. Default: 20. Range: 1 to 200. | |
to_x | number | required | Drag-end X in window-local screenshot pixels. |
to_y | number | required | Drag-end Y in window-local screenshot pixels. |
window_id | integer | CGWindowID for the window the pixel coordinates were measured against. Optional only when pid owns exactly one eligible top-level window; otherwise the action refuses with ambiguous_window_target. |
Parameters on every platform
| Parameter | Type | Default | Description |
|---|---|---|---|
session | string | For 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. | |
target | object | Preferred per-call target: an exact window (kind="window", pid, window_id) or the primary desktop (kind="desktop", display_id="primary"). | |
target.display_id | string | Display id. Required when kind is desktop; use "primary". | |
target.kind | "window" | "desktop" | window requires pid and window_id; desktop requires display_id. | |
target.pid | integer | Process id. Required when kind is window. Minimum: 0. | |
target.window_id | integer | Window id from list_windows. Required when kind is window. Minimum: 0. |
Example arguments
{"from_x":100,"from_y":200,"to_x":100,"to_y":200}scroll#
Effect: mutating. Platforms: macOS, Linux, Windows.
Scroll the target pid.
- Targeted wheel: pass
element_token(preferred) or window-localx, y. Sends a real wheel event at that point, so it scrolls whatever is under it. The only way to scroll nestedoverflow:autoregions in web views. - Keystroke: no target, just pid + direction. PageDown/PageUp (by='page') or arrows (by='line') on the focused scroller.
Electron/Chromium windows drop background wheel events: there a background scroll reveals the content just past the edge of the scroll container under the target through accessibility (about amount notches); delivery_mode:"foreground" is the fallback.
amount is wheel notches (targeted) or key repetitions (keystroke).
macOS parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
amount | integer | Wheel notches or key repetitions, clamped to the maximum. Default 3. Range: 1 to 50. | |
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. | |
pid | integer | Target process ID. Required unless scope is "desktop" or element_token is supplied. | |
scope | "window" | "desktop" | "window" | "desktop" with x,y and no pid/window_id uses get_desktop_state coordinates. |
session | string | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. | |
window_id | integer | Window ID. Required with x/y; optional with element_token. | |
x | number | Window-local screenshot X (get_window_state PNG). With y, wheel-scrolls at that point; needs window_id. | |
y | number | Window-local screenshot Y. |
Parameters on every platform
| Parameter | Type | Default | Description |
|---|---|---|---|
by | "line" | "page" | Scroll granularity. Default: line. | |
direction | "up" | "down" | "left" | "right" | required | Scroll direction. |
element_token | string | Element 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. | |
target | object | Preferred per-call target: an exact window (kind="window", pid, window_id) or the primary desktop (kind="desktop", display_id="primary"). | |
target.display_id | string | Display id. Required when kind is desktop; use "primary". | |
target.kind | "window" | "desktop" | window requires pid and window_id; desktop requires display_id. | |
target.pid | integer | Process id. Required when kind is window. Minimum: 0. | |
target.window_id | integer | Window id from list_windows. Required when kind is window. Minimum: 0. |
Example arguments
{"direction":"up"}move_cursor#
Effect: mutating, idempotent. Platforms: macOS, Linux, Windows.
Move a cursor to (x, y). With target {kind: "window", pid, window_id}, x/y are window screenshot pixels (as for click) and only the agent cursor moves there; in a background app it also hovers through a route that leaves the real pointer alone where one exists (AXShowAlternateUI on the element under the point, or an Electron page) and says so. Without a target, moves only the agent cursor overlay, in screen points. Other macOS hover and tooltips follow the real pointer, so most background apps see no hover; for a web page in Chrome, Edge or Brave use browser_pointer hover instead. With scope=desktop, moves the user's real OS pointer in native get_desktop_state screenshot coordinates; over a window of an app that is not in front it refuses unless delivery_mode is "foreground".
macOS parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
delivery_mode | "background" | "foreground" | Desktop scope only. Default "background": refuses, before moving anything, when the point is over a window of an app that is not in front, since that would move the user's pointer. "foreground": move the real pointer anyway; only when nobody is using this screen or the user agreed. | |
scope | "window" | "desktop" | "window" | "window" (default) moves only the agent cursor overlay; "desktop" moves the real OS pointer. |
x | number | required | Destination X. Window target: window screenshot pixels. No target: screen points for the agent cursor overlay. Desktop scope: native get_desktop_state screenshot pixels. |
Parameters on every platform
| Parameter | Type | Default | Description |
|---|---|---|---|
cursor_id | string | Cursor instance to move. Default: 'default'. | |
session | string | For 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. | |
target | object | Preferred per-call target: an exact window (kind="window", pid, window_id) or the primary desktop (kind="desktop", display_id="primary"). | |
target.display_id | string | Display id. Required when kind is desktop; use "primary". | |
target.kind | "window" | "desktop" | window requires pid and window_id; desktop requires display_id. | |
target.pid | integer | Process id. Required when kind is window. Minimum: 0. | |
target.window_id | integer | Window id from list_windows. Required when kind is window. Minimum: 0. | |
y | number | required | Destination Y, in the same space as x. |
Example arguments
{"x":100,"y":200}mouse_button_down#
Press and hold a mouse button at (x,y) via background X11 delivery. Does not release the button; pair with mouse_drag / mouse_button_up. Returns the current held-button state.
Effect: destructive. Platforms: Linux.
| Parameter | Type | Default | Description |
|---|---|---|---|
button | "left" | "right" | "middle" | Mouse button. Default "left". | |
coordinate_frame | "window" | "desktop" | Frame of x/y (and from_x/from_y/to_x/to_y). Default "window": window-local screenshot pixels as returned by get_window_state. "desktop": full-screen pixels as returned by get_desktop_state, translated to the target window. Passing scope:"desktop" together with pid/window_id means the same thing. | |
cursor_id | string | Optional multi-cursor instance id. Default: 'default'. | |
from_zoom | boolean | Set true after a zoom call to auto-translate zoom-image pixel coordinates back to full-window space. | |
pid | integer | required | Target process ID. |
session | string | For 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. When both are present, session takes precedence over cursor_id. | |
window_id | integer | required | Window id from list_windows. |
x | number | required | Window-local pixel X of the target window's own get_window_state screenshot (0..screenshot_width). For get_desktop_state pixels pass scope:"desktop" (or coordinate_frame:"desktop"). |
y | number | required | Window-local pixel Y of the target window's own get_window_state screenshot (0..screenshot_height); see x. |
Example arguments
{"pid":1,"window_id":1,"x":100,"y":200}mouse_button_up#
Release a previously-held mouse button via background X11 delivery. If x/y are omitted, releases at the last held position. Returns the current held-button state.
Effect: destructive. Platforms: Linux.
| Parameter | Type | Default | Description |
|---|---|---|---|
coordinate_frame | "window" | "desktop" | Frame of x/y (and from_x/from_y/to_x/to_y). Default "window": window-local screenshot pixels as returned by get_window_state. "desktop": full-screen pixels as returned by get_desktop_state, translated to the target window. Passing scope:"desktop" together with pid/window_id means the same thing. | |
cursor_id | string | Optional multi-cursor instance id. Default: 'default'. | |
from_zoom | boolean | Set true after a zoom call to auto-translate zoom-image pixel coordinates back to full-window space. | |
pid | integer | Optional process ID; must match the held button's target. | |
session | string | For 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. When both are present, session takes precedence over cursor_id. | |
window_id | integer | Optional window id; must match the held button's target. | |
x | number | Window-local pixel X of the target window's own get_window_state screenshot (0..screenshot_width). For get_desktop_state pixels pass scope:"desktop" (or coordinate_frame:"desktop"). | |
y | number | Window-local pixel Y of the target window's own get_window_state screenshot (0..screenshot_height); see x. |
mouse_drag#
Move a previously-held mouse button to a new point via background X11 delivery. Requires an active mouse_button_down state; does not release the button. Returns the updated held-button state.
Effect: destructive. Platforms: Linux.
| Parameter | Type | Default | Description |
|---|---|---|---|
cursor_id | string | Optional multi-cursor instance id. Default: 'default'. | |
duration_ms | integer | Total drag duration. Default: 500. Range: 0 to 10000. | |
from_zoom | boolean | Set true after a zoom call to auto-translate zoom-image pixel coordinates back to full-window space. | |
pid | integer | Optional process ID; must match the held button's target. | |
session | string | For 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. When both are present, session takes precedence over cursor_id. | |
steps | integer | Intermediate MotionNotify events. Default: 20. Range: 1 to 200. | |
window_id | integer | Optional window id; must match the held button's target. | |
x | number | required | Window-local pixel X of the target window's own get_window_state screenshot (0..screenshot_width). For get_desktop_state pixels pass scope:"desktop" (or coordinate_frame:"desktop"). |
y | number | required | Window-local pixel Y of the target window's own get_window_state screenshot (0..screenshot_height); see x. |
Example arguments
{"x":100,"y":200}parallel_mouse_drag#
Run multiple mouse drag gestures concurrently via Linux MPX/XI2 virtual master pointers. Each drag item runs on its own session-scoped master pointer (true same-window concurrent draws on X11). Each item presses once, glides continuously through its whole path, and releases once: one smooth held drag, not a chain of clicks. A path is given either as a straight segment (from_x/from_y → to_x/to_y) or as a function fn = y(x) sampled over [x_from, x_to] in window-local pixels (e.g. fn:"x" is a diagonal, fn:"300+120*sin(x/40)" a sine wave). Functions support + - * / ^, sin/cos/tan, sqrt, abs, exp, ln, pi, e.
Effect: destructive. Platforms: Linux.
| Parameter | Type | Default | Description |
|---|---|---|---|
drags | object[] | required | Two or more drag gestures to run concurrently, each on its own virtual master pointer. Items: 2 to any. |
session | string | For 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. |
Example arguments
{"drags":[{"session":"<session>","window_id":1},{"session":"<session>","window_id":1}]}Agent cursor tools#
Show, animate and style the agent cursor.
set_agent_cursor_enabled#
Show or hide the agent cursor owned by a session.
Effect: mutating, idempotent. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
enabled | boolean | required | true shows the session's agent cursor overlay; false hides it. |
session | string | required | Public label of the session that owns the cursor. |
Example arguments
{"session":"<session>","enabled":false}set_agent_cursor_motion#
Configure the movement style, timing, effects and visibility timing for a session cursor.
Effect: mutating, idempotent. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
arc_flow | number | Added to the arc asymmetry of signature_arc, spring_settle and comet_swoop: positive moves the apex toward the destination. Clamped to -1..1 (default 0). | |
arc_size | number | Scales the arc of signature_arc, spring_settle and comet_swoop: 0.25 (default) keeps the style's arc, 0 is a straight line, 0.5 doubles it. Clamped to 0..1. | |
dwell_after_click_ms | number | Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80). | |
effects | object | Turn effects on or off. Omit a field to keep it; "default" restores the style default. | |
effects.glow | "on" | "off" | "default" | Soft glow around the cursor that grows with speed. | |
effects.magnet | "on" | "off" | "default" | Target glow when the magnetic style locks on. | |
effects.ripple | "on" | "off" | "default" | Ring that expands from the hotspot on click. | |
effects.squish | "on" | "off" | "default" | Brief scale-down of the cursor on click. | |
effects.trail | "on" | "off" | "default" | Short fading trail behind the cursor. | |
end_handle | number | Arc control-point offset from the end, as a fraction of the distance, for signature_arc, spring_settle and comet_swoop. Clamped to 0..1 (default 0.3). | |
glide_duration_ms | number | Move duration in milliseconds for fixed timing (1430 ms when 0, the default). A nonzero value with native or the default steady timing also fixes the duration. Clamped to 0..5000. | |
idle_hide_ms | number | Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to 0..60000 (default 15000). | |
session | string | required | Public label of the session that owns the cursor. Omitted or null motion fields keep their current value. |
spring | number | Arrival spring damping for classic: 1 is critically damped, 0.3 is bouncy. Clamped to 0.3..1 (default 0.72). | |
start_handle | number | Arc control-point offset from the start, as a fraction of the distance, for signature_arc, spring_settle and comet_swoop. Clamped to 0..1 (default 0.3). | |
style | "signature_arc" | "spring_settle" | "magnetic" | "comet_swoop" | "adaptive" | "classic" | Trajectory style. signature_arc (default) is one arc with a small follow-through; spring_settle lands with one soft bounce; magnetic is pulled into the target; comet_swoop is a wide arc with a short trail; adaptive picks a careful approach for small targets and a swoop for long moves; classic is the previous Dubins glide. When the theme's reduced motion is on, every move is a short straight glide with no effects. | |
timing | "native" | "fitts" | "fixed" | "relaxed" | "steady" | "calm" | "deliberate" | steady (default) keeps the style's timing but makes every move take at least 600 ms, with a gentler ease; relaxed and calm do the same with a 450 or 750 ms floor. native uses the style's own timing; fitts scales the move time with distance and target size; deliberate is a slower Fitts curve (450..1300 ms); fixed uses glide_duration_ms (1430 ms when 0). | |
turn_radius | number | Minimum turning radius of the classic glide path, in points; smaller turns tighter. Clamped to 1..1000 (default 80). |
Example arguments
{"session":"<session>"}set_agent_cursor_theme#
Select an already-installed cursor theme for a session.
Effect: mutating, idempotent. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
reduced_motion | "auto" | "on" | "off" | "auto" | Theme animation policy: on uses the theme's reduced-motion frames, off always animates, auto (default) leaves the choice to the host. |
session | string | required | Public label of the session that owns the cursor. |
theme_id | string | required | Id of an installed cursor theme (see cua-driver cursor-theme list). |
Example arguments
{"session":"<session>","theme_id":"<theme_id>"}get_agent_cursor_state#
Return the session cursor's theme, semantic playback, position, visibility, and motion.
Effect: read-only, idempotent. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
session | string | required | Public label of the session whose cursor to inspect. |
Example arguments
{"session":"<session>"}Page tools#
Read and act on web pages, and prepare and navigate browsers.
page#
Legacy browser compatibility tool. Prefer get_browser_state and the typed browser_* tools for exact targeting, endpoint ownership, and consent. Read-only get_text and query_dom remain available by default. Mutating actions require the daemon operator to set CUA_DRIVER_ENABLE_LEGACY_PAGE_MUTATIONS=1 before daemon startup (restart the daemon after changing it); this escape hatch does not provide the typed browser surface's exact binding or existing-profile grant guarantees. Supports Chrome, Brave, Edge, Safari (via AppleScript on macOS), Electron apps (via CDP), Chromium/Firefox on Windows (via UIA for read; CDP for execute_javascript when --remote-debugging-port is set), and WKWebView/Tauri/AT-SPI fallbacks.
Actions:
- execute_javascript: Run JS and return the result.
- get_text: Extract visible text from the page.
- query_dom: Find elements matching a CSS selector.
- click_element: Click a CSS-selected element AND animate the agent cursor to its on-screen center first (so the user sees what the agent is doing). Prefer over
execute_javascript('el.click()')whenever you want visible cursor feedback. - insert_text: Insert
textat whatever currently holds DOM focus in one native operation (CDP Input.insertText); no synthesized key events, but more durable than a one-shot execute_javascript write since rich-text editors already have to treat it like an IME commit. Try this before type_keystrokes on a contenteditable that discarded an execute_javascript write. Click/focus the target field first. - type_keystrokes: Type
textvia real per-character keystroke events into whatever currently holds DOM focus. Slower than insert_text but the most durable rung: use it when insert_text also gets discarded, or the editor's own keydown/keyup handlers need to see real keys. Click/focus the target field first. - enable_javascript_apple_events: macOS-only; patch the browser's Preferences to allow JS from Apple Events (Chrome/Brave/Edge, requires user confirmation and a browser restart).
Effect: mutating. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
action | "execute_javascript" | "get_text" | "query_dom" | "click_element" | "insert_text" | "type_keystrokes" | "enable_javascript_apple_events" | required | Action to perform. |
attributes | string[] | Element attributes to include in query_dom results. | |
bundle_id | string | Bundle ID of the browser. Required for enable_javascript_apple_events (macOS only). | |
cdp_port | integer | Optional, for execute_javascript/insert_text/type_keystrokes: use this exact CDP port instead of auto-discovering one from pid. Needed when the port was opened via the browser's own remote-debugging toggle rather than a launch-time flag, since that path may not answer the auto-discovery probe. Range: 1 to 65535. | |
css_selector | string | CSS selector for query_dom (e.g. 'a', 'button', 'input', 'h1'-'h6', 'p', 'img', 'select', '*'). | |
javascript | string | JavaScript to execute. Required for execute_javascript. | |
pid | integer | Target process ID. | |
selector | string | CSS selector for click_element (e.g. 'button.submit', '#login a'). | |
session | string | For 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. | |
target_url_contains | string | Optional, for execute_javascript/insert_text/type_keystrokes: require exactly one browser tab whose URL contains this substring. Use this on a multi-tab browser: there's no built-in link between window_id and which tab a CDP call reaches. | |
text | string | Text to insert or type. Required for insert_text and type_keystrokes. The target field must already have DOM focus (click/focus it first). | |
user_has_confirmed_enabling | boolean | Must be true to proceed with enable_javascript_apple_events. This will quit and relaunch the browser. | |
window_id | integer | Target window ID from list_windows. |
Example arguments
{"action":"execute_javascript"}get_browser_state#
Read-only browser inspection. Mode 1 (bind): pass pid + window_id of a native browser window to classify it, correlate it to a CDP target (exact-or-refuse), and mint a session-scoped target id plus tab ids. Mode 2 (snapshot): pass target_id + tab_id. The dom_refs_v1 compatibility format returns composed DOM refs. semantic_v2 joins accessibility, DOM, layout, and viewport state; ranks visible content before retained/offscreen state; and returns a semantic outline, typed action refs, content refs, scoped reads, and opaque continuation. Never performs setup: a browser that is not attached yet refuses with browser_consent_required or browser_requires_setup, and detail.next_call names the browser_prepare call that attaches it. Use this route for any web page in Chrome, Edge or Brave; desktop pointer tools move the user's pointer. Setup and recovery: get_guide({topic:"browser"}).
Effect: read-only, idempotent. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
continuation | string | Opaque continuation minted by an earlier semantic_v2 response. | |
include_screenshot | boolean | false | Capture the exact tab viewport as PNG through CDP without selecting the tab or foregrounding its native window. The request refuses if capture cannot be completed. |
pid | integer | Native browser process id (bind mode). | |
query | string | Read-only semantic match over role, accessible name, and visible text. | |
scope_ref | string | Current semantic/content ref whose subtree should be observed. | |
session | string | For 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. Browser targets, tabs, and refs belong to the resolved lifecycle session. | |
snapshot_format | "dom_refs_v1" | "semantic_v2" | Versioned snapshot contract. dom_refs_v1 remains the compatibility default. | |
tab_id | string | Opaque tab id from get_browser_state (session-scoped). | |
target_id | string | Opaque browser target id minted by get_browser_state (session-scoped; never a CDP id). | |
window_id | integer | Native window id owned by pid (bind mode). |
browser_prepare#
Attach the browser tools to a browser. For a page in the user's running Chrome, Edge or Brave, call it once with pid, window_id, session and strategy {"kind":"existing_profile"} when get_browser_state refuses with browser_consent_required or browser_requires_setup; then call get_browser_state again and act with browser_click, browser_type or browser_pointer. It attaches, or refuses with nothing changed and says why. Explicitly prepare an owned DevTools endpoint for a browser. pid is required for an existing process or existing-profile attachment, and optional only for allow_launch=true with an isolated profile. Existing endpoints are detected without side effects. Acting setup for an isolated profile follows the runtime permission mode and optional capability manifest. It requires allow_launch=true, launches a separate browser, and never copies, modifies, or terminates the requested user profile. Without pid, only a platform-attested system Chrome/Edge installation (or a root-owned package payload on Linux) is eligible; redirects and user-controlled locations fail closed. Existing-profile attachment is explicit and follows the runtime's immutable permission mode: standard requires an explicit --grant existing-profile launch grant or an embedding authorization host, bounded requires a launch-approved exact resource manifest, and unrestricted requires explicit trusted startup risk acceptance. Ordinary MCP transport approval never proves profile authorization. On proven platforms, an authorized request also permits one bounded exact-window setup: open the recognized browser product's fixed remote-debugging page, toggle its uniquely matched per-instance checkbox, prove the PID-owned loopback endpoint, and close the temporary tab. Every visible effect is reported; ambiguity is refused. Where attaching would bring the browser in front of the user's app (macOS Chrome shows its own remote-debugging prompt in front whenever the driver opens a new browser connection; sessions for the same browser share one approved connection, kept for up to 30 minutes idle and 8 hours in total, so later sessions do not prompt again), existing-profile attachment refuses with background_unavailable unless delivery_mode is "foreground" (the app that was in front is brought back afterwards) or the browser window is on another Space than the user's, where it attaches in the background while the driver reverts the browser's own brief activations. A driver-owned isolated launch result carries an advisory lifecycle object: the browser process ends with the calling session after idle_expires_in_seconds without session activity, an isolated_named profile persists after the session and an isolated_new profile does not, and explicit end, disconnect, revocation or shutdown end it earlier. Setup and recovery: get_guide({topic:"browser"}).
Effect: destructive. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
allow_launch | boolean | Allow a separate driver-owned isolated Chromium process to be launched (default false). | |
delivery_mode | "background" | "foreground" | "background" | Existing-profile attachment only. background (default) attaches in the background when the browser window is on another Space than the user's, and otherwise refuses with background_unavailable, before any visible effect, where attaching would bring the browser in front of the user's app. foreground accepts that, for a screen nobody else is using or when the user agreed; the app that was in front is brought back afterwards. |
pid | integer | Browser process id to prepare. Required except for a driver-owned isolated_new/isolated_named launch with allow_launch=true. | |
profile | object | Driver-owned isolated Chromium profile to launch with allow_launch=true. mode=isolated_new creates a fresh throwaway profile; mode=isolated_named reuses the named driver-owned profile. Never an existing user profile. | |
profile.mode | "isolated_new" | "isolated_named" | ||
profile.name | string | Required only for isolated_named; 1-64 path-safe ASCII characters. | |
session | string | For 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. Browser targets, tabs, and refs belong to the resolved lifecycle session. | |
strategy | object | Attach to an already-running browser instead of launching one. Pass an object, {"kind":"existing_profile"}, not a string. kind=existing_profile attaches to the user's running profile at pid/window_id under the runtime's profile authorization. | |
strategy.kind | "existing_profile" | ||
window_id | integer | Exact native window approval anchor; required for strategy.kind=existing_profile. |
browser_navigate#
Navigate one tab of an exactly-bound browser target to a new URL (http/https/about only). Refused for heuristic bindings. Navigation invalidates all p<snapshot>:<index> refs for the tab.
Effect: mutating. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
session | string | For 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. Browser targets, tabs, and refs belong to the resolved lifecycle session. | |
tab_id | string | required | Opaque tab id from get_browser_state (session-scoped). |
target_id | string | required | Opaque browser target id minted by get_browser_state (session-scoped; never a CDP id). |
url | string | required | Destination URL (http:, https:, or about:). |
Example arguments
{"target_id":"<target_id>","tab_id":"<tab_id>","url":"<url>"}Browser input tools#
Exact browser input over CDP: clicks, typing, pointer, dialogs, files and downloads.
browser_click#
Click a page element (by ref) or viewport coordinates in an exactly-bound tab. Default route is trusted hardware-like input (Input.dispatchMouseEvent), and refuses where that route cannot preserve standalone-browser background posture unless delivery_mode="foreground" accepts that the browser window may activate (including Linux Chromium configurations whose trusted route cannot stay in the background; for example a browser inside a sandbox). input_route="dom_event" (synthetic pointer and mouse down/up/click sequence at the element's center, ref required) is used only when explicitly requested; it proves dispatch, not control activation, because trust-gated controls may ignore synthetic events. Refused for heuristic bindings.
Effect: mutating. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
delivery_mode | "background" | "foreground" | "background" | background (default) refuses trusted input where it would activate the browser window, including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background. foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox). |
input_route | "trusted" | "dom_event" | "trusted" (default): Input.dispatchMouseEvent. It refuses rather than foregrounding a standalone browser. "dom_event": synthetic full-background DOM click, only when explicitly requested. Dispatch does not prove the control activated; refresh page state and verify the expected postcondition. | |
ref | string | Page element ref in the p<snapshot>:<index> namespace from get_browser_state. Refs are invalidated by navigation and by newer snapshots of the same tab. | |
session | string | For 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. Browser targets, tabs, and refs belong to the resolved lifecycle session. | |
tab_id | string | required | Opaque tab id from get_browser_state (session-scoped). |
target_id | string | required | Opaque browser target id minted by get_browser_state (session-scoped; never a CDP id). |
x | number | Viewport x (CSS px): alternative to ref. | |
y | number | Viewport y (CSS px): alternative to ref. |
Example arguments
{"target_id":"<target_id>","tab_id":"<tab_id>"}browser_type#
Type text into an exactly-bound tab via the Input domain. mode="insert_text" (default) uses Input.insertText; mode="keystrokes" dispatches per-character key events. Both insert at the caret, so typing into a field that already holds text appends to it; pass replace=true to set the field instead, or to clear it by typing an empty string. Pass a ref to an editable element from the latest snapshot. A ref is required; heuristic bindings are refused.
Effect: mutating. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
mode | "insert_text" | "keystrokes" | insert_text (default): bulk Input.insertText. keystrokes: per-character Input.dispatchKeyEvent. | |
ref | string | required | Page element ref in the p<snapshot>:<index> namespace from get_browser_state. Refs are invalidated by navigation and by newer snapshots of the same tab. |
replace | boolean | false (default): insert at the caret, appending to whatever the field already holds. true: select the element's whole content first so the text replaces it; with an empty text this clears the field. Replacement goes through the selection, so beforeinput/input still fire and framework state stays consistent. | |
session | string | For 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. Browser targets, tabs, and refs belong to the resolved lifecycle session. | |
tab_id | string | required | Opaque tab id from get_browser_state (session-scoped). |
target_id | string | required | Opaque browser target id minted by get_browser_state (session-scoped; never a CDP id). |
text | string | required | Text to type. |
Example arguments
{"target_id":"<target_id>","tab_id":"<tab_id>","ref":"<ref>","text":"<text>"}browser_select#
Select one option of a native HTML <select> ref on an exactly-bound tab without opening its popup. Pass exactly one of label or value; exactly one option must equal it. Refuses non-native, multiple-selection, and disabled selects, disabled options, and zero or ambiguous matches before changing anything. A change dispatches bubbling input and change events; they are synthetic, so verify the page accepted the selection. Selecting the option that is already selected dispatches no events.
Effect: mutating. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
label | string | Exact visible label of the option to select. | |
ref | string | required | Page element ref in the p<snapshot>:<index> namespace from get_browser_state. Refs are invalidated by navigation and by newer snapshots of the same tab. |
session | string | For 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. Browser targets, tabs, and refs belong to the resolved lifecycle session. | |
tab_id | string | required | Opaque tab id from get_browser_state (session-scoped). |
target_id | string | required | Opaque browser target id minted by get_browser_state (session-scoped; never a CDP id). |
value | string | Exact value attribute of the option to select. |
Example arguments
{"target_id":"<target_id>","tab_id":"<tab_id>","ref":"<ref>"}browser_pointer#
Perform hover, right-click, double-click, scroll, or drag in an exactly-bound browser tab. Semantic refs must declare pointer for hover, right-click, double-click, and drag; scroll accepts a scroll or pointer capability. The trusted route uses CDP Input events and refuses if standalone background posture cannot be preserved. The explicit dom_event route requires a page ref and synthesizes full-background DOM events. Never activates or brings a tab to the foreground.
Effect: mutating. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
action | "hover" | "right_click" | "double_click" | "scroll" | "drag" | required | Pointer gesture. scroll needs delta_x or delta_y; drag needs destination_ref or to_x/to_y. |
delivery_mode | "background" | "foreground" | "background" | background (default) refuses trusted input where it would activate the browser window, including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background. foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox). |
delta_x | number | Horizontal scroll delta in CSS pixels. | |
delta_y | number | Vertical scroll delta in CSS pixels. | |
destination_ref | string | Drag destination page ref in the exact same frame. | |
input_route | "trusted" | "dom_event" | "trusted" | trusted sends CDP Input events; dom_event synthesizes DOM events in the page and requires ref. |
ref | string | Origin page ref. Alternative to x/y. | |
session | string | required | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. This tool requires the label that owns its browser target, tab, and refs. |
tab_id | string | required | Opaque tab id minted by get_browser_state. |
target_id | string | required | Opaque target id minted by get_browser_state. |
to_x | number | Drag destination viewport x in CSS pixels. | |
to_y | number | Drag destination viewport y in CSS pixels. | |
x | number | Origin viewport x in CSS pixels. | |
y | number | Origin viewport y in CSS pixels. |
Example arguments
{"target_id":"<target_id>","tab_id":"<tab_id>","session":"<session>","action":"hover"}browser_dialog#
Inspect or resolve a page-owned JavaScript alert, confirm, prompt, or beforeunload dialog on one exactly-bound tab. This never handles browser permission UI, extension UI, native dialogs, or file pickers. Inspect returns an opaque dialog_id; accept/dismiss require that exact current id. Resolution defaults to background delivery; Linux callers must explicitly request foreground delivery because Chromium's native modal cannot be resolved there without changing foreground posture.
Effect: mutating. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
action | "inspect" | "accept" | "dismiss" | required | inspect returns the current dialog and its dialog_id; accept or dismiss resolves that exact dialog. |
delivery_mode | "background" | "foreground" | "background" | Requested foreground posture for accept/dismiss. Linux Chromium requires foreground; inspect is read-only. |
dialog_id | string | Opaque current dialog generation returned by action=inspect. | |
prompt_text | string | Sensitive response text, valid only when accepting a prompt dialog. | |
session | string | For 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. Browser targets, tabs, and refs belong to the resolved lifecycle session. | |
tab_id | string | required | Opaque tab id from get_browser_state (session-scoped). |
target_id | string | required | Opaque browser target id minted by get_browser_state (session-scoped; never a CDP id). |
Example arguments
{"target_id":"<target_id>","tab_id":"<tab_id>","action":"inspect"}browser_set_input_files#
Assign one or more explicit absolute local files to an exact live <input type=file> ref through CDP. This bypasses native file pickers, rejects symlinks and non-regular files, and never returns local paths.
Effect: mutating. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
files | string[] | required | Absolute paths of 1 to 32 local regular files to assign to the input. Items: 1 to 32. |
ref | string | required | Page element ref in the p<snapshot>:<index> namespace from get_browser_state. Refs are invalidated by navigation and by newer snapshots of the same tab. |
session | string | For 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. Browser targets, tabs, and refs belong to the resolved lifecycle session. | |
tab_id | string | required | Opaque tab id from get_browser_state (session-scoped). |
target_id | string | required | Opaque browser target id minted by get_browser_state (session-scoped; never a CDP id). |
Example arguments
{"target_id":"<target_id>","tab_id":"<tab_id>","ref":"<ref>","files":["<file>"]}browser_download#
Trigger one download through an exact live browser ref and save it inside an explicitly approved directory. Requires MCP-host destructive-tool approval, refuses ambiguous or stale capabilities, and never returns the source URL, filename, or destination path.
Effect: destructive. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
destination_root | string | required | Absolute, existing, canonical directory approved to receive the download. |
ref | string | required | Live page ref whose activation initiates the download. |
session | string | required | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. This tool requires the label that owns its browser target, tab, and refs. |
tab_id | string | required | Opaque exact tab id from get_browser_state. |
target_id | string | required | Opaque exact browser target id from get_browser_state. |
Example arguments
{"session":"<session>","target_id":"<target_id>","tab_id":"<tab_id>","ref":"<ref>","destination_root":"<destination_root>"}