codex-computer-use-mcp
by prometheorhq
README.md
# codex-computer-use-mcp
Use **Codex's Computer Use** from Claude Code, Cursor or any other MCP client on macOS.
Codex has very good Computer Use: it sees and operates any Mac app through screenshots, the accessibility tree,
clicks and typing. But only Codex can reach it. This small MCP server hands it to your other agents as a normal
tool, `computer_use`, so for example Claude can drive it directly in its own session instead of starting a
separate Codex thread for every UI step.
Claude drives, Codex clicks.
## How it works
Codex runs its own Computer Use service; it only runs under a program OpenAI signed. This server copies or ships
none of it. It starts the Codex you already have installed as `codex app-server` and uses its app-server methods:
1. `initialize`, then `thread/start` with `ephemeral: true`. No model turn is started, so **no OpenAI model runs**.
Your agent decides every step.
2. `mcpServerStatus/list` to find Codex's Computer Use MCP server (`cua_repl`, plugin `unified-computer-use`).
3. `mcpServer/tool/call` for each call your agent makes.
After a minute without calls it reports the turn as ended to Computer Use and closes the app-server, so the
"using your Mac" indicator goes away.
```
Claude Code / Cursor ──MCP──▶ codex-computer-use-mcp ──app-server──▶ Codex ──▶ Computer Use ──▶ your Mac apps
```
## Requirements
- macOS
- Node.js 22.18 or newer
- The Codex app (or the ChatGPT desktop app with Codex), signed in, with the **Computer Use** plugin installed
and its macOS permissions (Screen Recording, Accessibility) granted
The server uses the Codex CLI bundled with the ChatGPT or Codex app if present, otherwise `codex` on your PATH.
Set `CODEX_COMPUTER_USE_CODEX_PATH` to choose another one.
## Install
```sh
git clone https://github.com/prometheorhq/codex-computer-use-mcp.git
cd codex-computer-use-mcp
```
There are no runtime dependencies and no build step: Node runs the TypeScript directly.
### Claude Code
```sh
claude mcp add -s user codex-computer-use -- "$PWD/bin/codex-computer-use-mcp"
```
Start a new Claude Code session. The tools appear as `computer_use` and `computer_use_reset`. Claude threads in
T3 Code use the same Claude Code configuration, so they get the tool as well.
### Cursor and other MCP clients
```json
{
"mcpServers": {
"codex-computer-use": {
"command": "/absolute/path/to/codex-computer-use-mcp/bin/codex-computer-use-mcp"
}
}
}
```
## Using it
`computer_use` takes JavaScript for Codex's `cua_repl` runtime. The tool description carries Codex's own API
documentation, so the agent can read it. A first call is usually:
```js
await cua.getState();
```
which lists the apps it can operate.
**Browsers:** Codex's browser-tab API (`createBrowserTab`, `getBrowser`, `getTab`) only works inside the Codex or
ChatGPT app. Through this server it fails with "The browser access host is unavailable" or "Cannot verify browser
access without the current turn". Operate the browser as a normal app instead:
```js
let app = await cua.getApp("Google Chrome");
```
Screenshots, clicks and typing work as in any other app.
## Safety
- **It never approves anything on your behalf.** When Codex asks to allow an app, the server declines and tells the
agent to ask you to allow it once in the Codex app.
- Codex's own Computer Use confirmation rules still apply. For example, it stops and asks before creating
accounts or keys.
- Codex gets only a minimal environment (`HOME`, `PATH`, locale and similar). No other provider's API keys reach it.
- Codex's Computer Use answers one client at a time. A lock file makes calls from several chats wait for each other.
## Limits
- macOS only, and local: it operates the Mac it runs on.
- It relies on Codex's app-server API with `experimentalApi: true`, which may change between Codex releases.
- One Computer Use call at a time across all clients.
- Not affiliated with OpenAI or Anthropic. "Codex" and "Claude" are their respective owners' trademarks.
## Configuration
| Variable | Default | Purpose |
| --- | --- | --- |
| `CODEX_COMPUTER_USE_CODEX_PATH` | app-bundled Codex CLI, then `codex` | Which Codex binary to start |
| `CODEX_COMPUTER_USE_STATE_DIR` | `~/.cache/codex-computer-use-mcp` | Tool-list cache and the call lock |
## Development
```sh
npm install # dev tools only (TypeScript, Node types)
npm run typecheck
npm test
```
## License
MIT. Built by [Prometheor](https://prometheor.com), which connects the AI apps you already have.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues