App and window tools
List, launch, quit, front and arrange apps and windows.
List, launch, quit, front and arrange apps and windows.
| Tool | Description | Platforms |
|---|---|---|
list_apps | List macOS apps, both currently running and installed-but-not-running, with per-app state flags: - running: is a process for this app live? | macOS, Linux, Windows |
list_windows | List all layer-0 top-level windows currently known to WindowServer. | macOS, Linux, Windows |
launch_app | Launch a macOS app in the background: the target does NOT come to the foreground. | macOS, Linux, Windows |
kill_app | Force-terminate a process by pid (kill -9 equivalent on macOS / Linux; taskkill /F equivalent on Windows). | macOS, Linux, Windows |
bring_to_front | Persistently activate an app and leave it in the foreground. | macOS, Linux, Windows |
set_window_frame | Set one exact top-level window's frame in the desktop-coordinate space reported by list_windows and verify the resulting geometry through an independent readback. | macOS, Linux, Windows |
invoke_menu | Resolve an exact application-menu path one live native level at a time and invoke its final item through accessibility APIs. | macOS, Linux, Windows |
debug_window_info | Diagnostic: dump everything cua-driver sees about a pid's top-level windows from the daemon's session perspective. | Windows |
Served by cua-driver mcp; see MCP tools for every tool.
list_apps#Effect: read-only, idempotent. Platforms: macOS, Linux, Windows.
List macOS apps, both currently running and installed-but-not-running, with per-app state flags:
.app bundle, when known. Pass this to launch_app to start the app cold."desktop" for .app bundles on macOS.Standalone running entries include only apps with NSApplicationActivationPolicyRegular: background helpers and system UI agents are filtered out. Installed apps resolve their running/pid state against all live processes by bundle identifier, so an installed app whose process runs as an accessory (LSUIElement / menu-bar apps, e.g. Cua Driver itself) still reports its live pid. Installed apps come from scanning /Applications, /Applications/Utilities, ~/Applications, /System/Applications, and /System/Applications/Utilities.
Use this for "is X installed?" as well as "is X running?". For per-window state, on-screen, on-current-Space, minimized, window titles, call list_windows instead. For just opening an app, running or not, call launch_app({bundle_id: ...}) directly; list_apps is not a prerequisite.
Parameters
| 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. |
list_windows#Effect: read-only, idempotent. Platforms: macOS, Linux, Windows.
List all layer-0 top-level windows currently known to WindowServer. Includes off-screen windows (minimized, on another Space, hidden-launched). Use this to find a window_id before calling get_window_state.
Per-record fields: window_id, pid, app_name, title, bounds (x/y/width/height, top-left origin), z_index (integer or null; higher values are closer to the front; null means stacking order is unavailable and callers must not infer one), is_on_screen, space_ids, current_space_id (the active Space on that window's display), and on_current_space. The top-level current_space_id is WindowServer's main/global active Space and can differ from a record's current_space_id when displays use independent Spaces. To select a frontmost candidate, take the maximum integer z_index; if every value is null, use an explicit fallback instead of relying on array order.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
on_screen_only | boolean | When true, drop windows not on the current Space. Default false. | |
pid | integer | Optional pid filter. When set, only this pid's windows are returned. | |
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. |
launch_app#Effect: mutating, idempotent. Platforms: macOS, Linux, Windows.
Launch a macOS app in the background: the target does NOT come to the foreground.
Provide either bundle_id (preferred: unambiguous, e.g. com.apple.calculator) or name (e.g. "Calculator"). If both are given, bundle_id wins.
Optional urls are handed to the app as open targets: for Finder, pass a folder path to open a backgrounded Finder window there.
Browser DevTools setup belongs to browser_prepare, which can prove that a separate isolated profile is driver-owned before enabling CDP.
Optional webkit_inspector_port: opens a WebKit inspector server on the specified port (sets WEBKIT_INSPECTOR_SERVER=127.0.0.1:N + TAURI_WEBVIEW_AUTOMATION=1). Use this for Tauri/WebKit-based apps.
Optional creates_new_application_instance: when true, forces a new app instance even if one is already running (passes -n to open). Reach for this when another agent or session may drive the SAME app concurrently: it returns a fresh pid + window so each session acts on its own isolated window instead of clobbering one shared instance. Without it, single-instance apps (Calculator, many utilities) hand every caller the same window, so two sessions fight over it.
Optional additional_arguments: extra argv strings appended after --args.
Returns the launched app's pid, bundle_id, name, and a windows array (same shape as list_windows) so callers can skip an extra round-trip before get_window_state(pid, window_id). launch_state distinguishes whether the request was sent, the process is running, and a window is ready. When the focus-steal belt-and-braces demotion check ran (target pid ≠ prior frontmost), the response also includes self_activation_suppressed: bool; true if focus stayed with the prior frontmost, false if the launched app held focus despite the re-demote attempt.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
additional_arguments | string[] | Extra arguments appended after --args when launching. | |
bundle_id | string | App bundle identifier, e.g. com.apple.calculator. Preferred over name. | |
creates_new_application_instance | boolean | When true, force a new app instance even if already running (open -n). Use for concurrent multi-agent/multi-session work so each session gets an isolated instance + window instead of sharing one: on single-instance apps (e.g. Calculator) every caller otherwise gets the same window and the sessions clobber each other. | |
name | string | App display name. Used only when bundle_id is absent. | |
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. | |
urls | string[] | Optional file paths or URLs to open with the app (e.g. a folder path for Finder). | |
webkit_inspector_port | integer | Open a WebKit inspector server on this port (sets WEBKIT_INSPECTOR_SERVER env var). |
kill_app#Effect: destructive, idempotent. Platforms: macOS, Linux, Windows.
Force-terminate a process by pid (kill -9 equivalent on macOS / Linux; taskkill /F equivalent on Windows). Use as escalation when the cooperative close path (hotkey cmd+q on macOS, click-the-X on Windows) failed to make the process exit. Unsaved state is lost: prefer the cooperative path first.
macOS parameters
| 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. |
Parameters on every platform
| Parameter | Type | Default | Description |
|---|---|---|---|
pid | integer | required | PID of the process to terminate. |
Example arguments
{"pid":1}bring_to_front#Effect: mutating, idempotent. Platforms: macOS, Linux, Windows.
Persistently activate an app and leave it in the foreground. Most input does not need this; use it only for a focus-proxy surface that must remain foreground across interactions. With window_id, success means the exact ordinary macOS window was independently verified as the frontmost process's focused window and the front window of that process on the display it sits on. exact_window_effect.frontmost_ordinary additionally reports whether it is first in the global WindowServer layer-0 order; another application (an always-raised utility window, another display's front window) can hold that spot without the requested window losing keyboard focus, so it is reported and not required. Request acceptance alone is reported as a partial result, never as activation. This DOES steal foreground and does NOT restore the previously frontmost application.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
pid | integer | required | Process ID of the app to activate. |
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. | |
window_id | integer | CGWindowID to verify as the focused, frontmost window. Omit to activate the app only. |
Example arguments
{"pid":1}set_window_frame#Set one exact top-level window's frame in the desktop-coordinate space reported by list_windows and verify the resulting geometry through an independent readback.
Effect: mutating, idempotent. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
height | number | required | New height, in the same units as list_windows bounds. Minimum: 1. |
pid | integer | required | Process ID that owns the window. Minimum: 1. |
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. | |
width | number | required | New width, in the same units as list_windows bounds. Minimum: 1. |
window_id | integer | required | Window ID from list_windows. Minimum: 1. |
x | number | required | New left edge in the desktop coordinate space reported by list_windows. |
y | number | required | New top edge in the desktop coordinate space reported by list_windows. |
Example arguments
{"pid":1,"window_id":1,"x":100,"y":200,"width":1,"height":1}invoke_menu#Resolve an exact application-menu path one live native level at a time and invoke its final item through accessibility APIs. Missing, ambiguous, disabled, or structurally mismatched segments fail closed; this tool never falls back to pixels.
Effect: destructive. Platforms: macOS, Linux, Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | string[] | required | Menu labels from the top-level menu to the item, e.g. ["File", "Save As..."] (1 to 16 labels). Items: 1 to 16. |
pid | integer | required | Process ID of the application that owns the menu. Minimum: 1. |
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. | |
window_id | integer | required | Window ID from list_windows whose menu is invoked. Minimum: 1. |
Example arguments
{"pid":1,"window_id":1,"path":["<path>"]}debug_window_info#Diagnostic: dump everything cua-driver sees about a pid's top-level windows from the daemon's session perspective. Returns window class names, owning .exe basename + path, and, when CUIAutomation succeeds, the focused UIA element with the list of patterns it supports (ValuePattern, InvokePattern, TextPattern, TogglePattern, etc.). Used to design / debug input routing for XAML / UWP / WinUI3 targets; see CUA-543.
Effect: read-only, idempotent. Platforms: Windows.
| Parameter | Type | Default | Description |
|---|---|---|---|
pid | integer | required | PID of the process to inspect. |
Example arguments
{"pid":1}