Open Computer Use
Overview
Open Computer Use exposes Computer Use as a local CLI and stdio MCP server. It is not Codex.app-specific; adapt the commands and MCP config to the agent runtime you are operating in.
The macOS runtime requires macOS 14.0 or later. Windows and Linux use their own platform runtimes and are not subject to this macOS minimum.
It supports the same core tool surface across macOS, Linux, and Windows:
list_apps, get_app_state, click, perform_secondary_action, scroll,
drag, type_text, press_key, and set_value.
Core Workflow
- On macOS, run
sw_vers -productVersion before invoking the CLI and require macOS 14.0 or later. On older versions, explain that the runtime cannot launch; do not recommend doctor or permission changes as a fix for binary incompatibility.
- Check the CLI is installed with
open-computer-use -h or ocu -h. If installation or setup is missing, read references/installation.md.
- On supported macOS versions, run
open-computer-use doctor before the first real GUI task. If permissions are missing, ask the user to approve Accessibility and Screen Recording in the onboarding UI.
- Inspect available apps before acting:
open-computer-use call list_apps.
- Capture current UI state with
open-computer-use call get_app_state --args '{"app":"TextEdit"}'. The default state is usually enough for UI operation.
- When the task needs longer semantic text, such as chat history, email bodies, document text, or long form content, call
get_app_state with text_limit: 1000 or text_limit: "max".
- When visible long pages or lists appear incomplete even after scrolling, call
get_app_state with a larger max_tree_nodes or max_tree_depth.
- Prefer element-targeted actions using
element_index from the latest get_app_state result.
- For multi-step CLI work, use
open-computer-use call --calls '<json-array>' so one process can reuse the latest element index mapping.
- For agent runtimes that support local MCP servers, configure
open-computer-use mcp or ocu mcp and call the exposed Computer Use tools directly. Read references/usage.md.
- For Opentrons App setup, high-level CLI commands, AT-SPI navigation, or Linux-specific failures, read references/opentrons-linux.md.
- If communication, permission, or desktop-session access fails, read references/troubleshooting.md.
Operating Rules
- Treat the target desktop as the user's real session. Do not inspect password managers, unrelated private content, or sensitive apps unless the user explicitly asked for that task.
- Ask before sending, deleting, purchasing, approving, uploading, or making other externally visible changes.
- Do not assume Codex.app plugin helpers are available. Use the installed
open-computer-use / ocu CLI or an explicit MCP config.
- Always run
get_app_state before using element_index; do not guess indexes across sessions or after large UI changes.
- Prefer semantic actions and
set_value for editable controls. Use coordinate click, scroll, and drag only when the element tree does not expose a safer target.
- On macOS, do not enable
OPEN_COMPUTER_USE_ALLOW_GLOBAL_POINTER_FALLBACKS=1 unless the user explicitly requested click_method: "global" or other diagnostic behavior that may move the real pointer.
- On Windows and Linux, confirm the command is running inside the logged-in desktop session before assuming GUI automation is available.
Common CLI Actions
open-computer-use -h
ocu -h
open-computer-use doctor
open-computer-use call list_apps
ocu call list_apps
open-computer-use call get_app_state --args '{"app":"TextEdit"}'
open-computer-use call get_app_state --args '{"app":"TextEdit","text_limit":1000}'
open-computer-use call get_app_state --args '{"app":"TextEdit","text_limit":"max"}'
open-computer-use call get_app_state --args '{"app":"Google Chrome","max_tree_nodes":3000,"max_tree_depth":96}'
open-computer-use call click --args '{"app":"TextEdit","element_index":"0"}'
open-computer-use call type_text --args '{"app":"TextEdit","text":"Hello from Open Computer Use"}'
For a short sequence that reuses state in one process:
open-computer-use call --calls '[
{"tool":"get_app_state","args":{"app":"TextEdit"}},
{"tool":"press_key","args":{"app":"TextEdit","key":"Return"}}
]'
MCP Usage
For runtimes that can launch local MCP servers over stdio, use:
[mcp_servers.open_computer_use]
command = "open-computer-use"
args = ["mcp"]
Read references/usage.md for JSON config examples, direct tool-call patterns, and platform notes.
References
- references/installation.md: one-time CLI install, agent MCP install commands, and macOS permissions.
- references/usage.md: MCP config, direct CLI calls, sequencing, and platform behavior.
- references/troubleshooting.md: permission, desktop-session, app discovery, and action failures.
- references/opentrons-linux.md: Opentrons Electron setup, PID-targeted CLI workflows, AT-SPI
jump navigation, and verified failure recovery.
- references/opentrons-wayland.md: GNOME WinRects setup, native cua-driver foreground fallback, exact-window targeting, Remote Desktop consent, and calibration-busy troubleshooting.
1---2name: open-computer-use3description: Platform-neutral guidance for using Open Computer Use, the open-source Computer Use MCP server and CLI for macOS, Linux, and Windows. Use when an agent needs to install, verify, troubleshoot, configure, or operate Open Computer Use through its native CLI, stdio MCP server, or direct Computer Use tool calls.4---56# Open Computer Use78## Overview910Open Computer Use exposes Computer Use as a local CLI and stdio MCP server. It is not Codex.app-specific; adapt the commands and MCP config to the agent runtime you are operating in.1112The macOS runtime requires macOS 14.0 or later. Windows and Linux use their own platform runtimes and are not subject to this macOS minimum.1314It supports the same core tool surface across macOS, Linux, and Windows:15`list_apps`, `get_app_state`, `click`, `perform_secondary_action`, `scroll`,16`drag`, `type_text`, `press_key`, and `set_value`.1718## Core Workflow19201. On macOS, run `sw_vers -productVersion` before invoking the CLI and require macOS 14.0 or later. On older versions, explain that the runtime cannot launch; do not recommend `doctor` or permission changes as a fix for binary incompatibility.212. Check the CLI is installed with `open-computer-use -h` or `ocu -h`. If installation or setup is missing, read [references/installation.md](references/installation.md).223. On supported macOS versions, run `open-computer-use doctor` before the first real GUI task. If permissions are missing, ask the user to approve Accessibility and Screen Recording in the onboarding UI.234. Inspect available apps before acting: `open-computer-use call list_apps`.245. Capture current UI state with `open-computer-use call get_app_state --args '{"app":"TextEdit"}'`. The default state is usually enough for UI operation.256. When the task needs longer semantic text, such as chat history, email bodies, document text, or long form content, call `get_app_state` with `text_limit: 1000` or `text_limit: "max"`.267. When visible long pages or lists appear incomplete even after scrolling, call `get_app_state` with a larger `max_tree_nodes` or `max_tree_depth`.278. Prefer element-targeted actions using `element_index` from the latest `get_app_state` result.289. For multi-step CLI work, use `open-computer-use call --calls '<json-array>'` so one process can reuse the latest element index mapping.2910. For agent runtimes that support local MCP servers, configure `open-computer-use mcp` or `ocu mcp` and call the exposed Computer Use tools directly. Read [references/usage.md](references/usage.md).3011. For Opentrons App setup, high-level CLI commands, AT-SPI navigation, or Linux-specific failures, read [references/opentrons-linux.md](references/opentrons-linux.md).3112. If communication, permission, or desktop-session access fails, read [references/troubleshooting.md](references/troubleshooting.md).3233## Operating Rules3435- Treat the target desktop as the user's real session. Do not inspect password managers, unrelated private content, or sensitive apps unless the user explicitly asked for that task.36- Ask before sending, deleting, purchasing, approving, uploading, or making other externally visible changes.37- Do not assume Codex.app plugin helpers are available. Use the installed `open-computer-use` / `ocu` CLI or an explicit MCP config.38- Always run `get_app_state` before using `element_index`; do not guess indexes across sessions or after large UI changes.39- Prefer semantic actions and `set_value` for editable controls. Use coordinate `click`, `scroll`, and `drag` only when the element tree does not expose a safer target.40- On macOS, do not enable `OPEN_COMPUTER_USE_ALLOW_GLOBAL_POINTER_FALLBACKS=1` unless the user explicitly requested `click_method: "global"` or other diagnostic behavior that may move the real pointer.41- On Windows and Linux, confirm the command is running inside the logged-in desktop session before assuming GUI automation is available.4243## Common CLI Actions4445```sh46open-computer-use -h47ocu -h48open-computer-use doctor49open-computer-use call list_apps50ocu call list_apps51open-computer-use call get_app_state --args '{"app":"TextEdit"}'52open-computer-use call get_app_state --args '{"app":"TextEdit","text_limit":1000}'53open-computer-use call get_app_state --args '{"app":"TextEdit","text_limit":"max"}'54open-computer-use call get_app_state --args '{"app":"Google Chrome","max_tree_nodes":3000,"max_tree_depth":96}'55open-computer-use call click --args '{"app":"TextEdit","element_index":"0"}'56open-computer-use call type_text --args '{"app":"TextEdit","text":"Hello from Open Computer Use"}'57```5859For a short sequence that reuses state in one process:6061```sh62open-computer-use call --calls '[63 {"tool":"get_app_state","args":{"app":"TextEdit"}},64 {"tool":"press_key","args":{"app":"TextEdit","key":"Return"}}65]'66```6768## MCP Usage6970For runtimes that can launch local MCP servers over stdio, use:7172```toml73[mcp_servers.open_computer_use]74command = "open-computer-use"75args = ["mcp"]76```7778Read [references/usage.md](references/usage.md) for JSON config examples, direct tool-call patterns, and platform notes.7980## References8182- [references/installation.md](references/installation.md): one-time CLI install, agent MCP install commands, and macOS permissions.83- [references/usage.md](references/usage.md): MCP config, direct CLI calls, sequencing, and platform behavior.84- [references/troubleshooting.md](references/troubleshooting.md): permission, desktop-session, app discovery, and action failures.85- [references/opentrons-linux.md](references/opentrons-linux.md): Opentrons Electron setup, PID-targeted CLI workflows, AT-SPI `jump` navigation, and verified failure recovery.86- [references/opentrons-wayland.md](references/opentrons-wayland.md): GNOME WinRects setup, native cua-driver foreground fallback, exact-window targeting, Remote Desktop consent, and calibration-busy troubleshooting.