codex-cu
Provides a bridge to OpenAI Codex's local macOS Computer Use engine (cua_repl / SkyComputerUseService) via codex app-server, enabling batched desktop automation without OpenAI LLM token usage.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
codex-cu-bridge
Lightweight, zero-dependency CLI + MCP bridge to OpenAI Codex's native macOS Sky Computer Use engine (cua_repl) via codex app-server.
Run batched, background-friendly macOS desktop automation from Antigravity, T3 Code, Claude Code, Cursor, or any MCP/shell-capable agent — with zero Codex LLM token cost, a hot-reloaded local App allowlist, and clean macOS menu bar session release.
Why codex-cu-bridge?
OpenAI's Codex / ChatGPT desktop app ships an exceptionally fast macOS Computer Use runtime (cua_repl + SkyComputerUseService) that reads accessibility trees, takes screenshots, and batches multi-step UI interactions in a persistent JavaScript REPL.
codex-cu-bridge exposes that engine through sanctioned local interfaces only (codex app-server's mcpServer/tool/call JSON-RPC protocol + SkyComputerUseClient turn-ended) without running any Codex LLM turn:
Zero npm dependencies, single-file core: ~1,800-line Node.js ESM script (
src/bridge.mjs) + a tiny optional Swift helper (native/sky-menu-inspector.swift).Zero Codex LLM tokens: invokes
cua_repl.jsdirectly viacodex app-servermcpServer/tool/callon an ephemeral thread — no OpenAI model completions are called.Fast CLI + persistent Unix-socket daemon + 6-tool MCP server:
Boots only
cua_repl(automatically disables all other configured[mcp_servers.*]andfeatures.appson the dedicated childcodex app-server).Warm CLI calls complete in ~200–300 ms and keep
globalThis/varapp handles alive across turns.Strips the 19 KB boilerplate first-use documentation by default (cached locally via
codex-cu-bridge docs) and auto-retries once after inactivity kernel resets for self-initializing scripts.
Local App allowlist: intercepts
mcpServer/elicitation/requestwith exact bundle ID & display name, auto-approves allowlisted apps, and safely cancels unlisted/denied apps with[APPROVAL_REQUIRED]instructions.Dual-path macOS menu bar & Software Cursor cleanup:
Injects
_meta["x-codex-turn-metadata"](session_id,turn_id,thread_id) and invokes the officialSkyComputerUseClient turn-endedhook onend/stop/ 20s idle (works seamlessly in hosts withNSAppleEventsUsageDescriptionsuch as T3 Code, Cursor, and Terminal).Includes
codex-cu-bridge releaseusing macOSCGWindowListCopyWindowInfo+ RetinaVisionOCR +cua-driveras a safe UI fallback for hosts that lackNSAppleEventsUsageDescription(e.g. standalone Antigravity Desktop), supporting multi-monitor setups, full-screen auto-hidden menu bars, and localized app names (e.g.Finder↔访达).
Ready-to-use Agent Skill: includes
skills/codex-cu-bridge/SKILL.mdwith batching patterns and the SkycuaJS API cheat sheet.
Related MCP server: macos-desktop-control
Architecture
Any Agent (Antigravity / T3 Code / Claude Code / Cursor / Shell)
│
├── CLI: `codex-cu-bridge js / end / release / allow / status`
└── MCP: `codex-cu-bridge mcp` (tools: js, end_turn, release, js_reset, allowlist, status)
│
▼ (Unix socket: ~/Library/Caches/codex-cu-bridge/bridge.sock)
codex-cu-bridge daemon (auto-exits after 3m idle)
│
├── JSON-RPC stdio ──▶ `codex app-server` (ephemeral thread, cua_repl only, 0 LLM tokens)
│ └── mcpServer/tool/call (`cua_repl.js` + `x-codex-turn-metadata`)
│ └── ChatGPT `cua_node` → `SkyComputerUseService`
│
├── Local policy ─────▶ ~/.config/codex-cu-bridge/allowlist.json (hot-reloaded)
└── Cleanup ──────────▶ 1) `cua_repl.turn_ended` + `SkyComputerUseClient turn-ended`
2) Optional `release`: `sky-menu-inspector` + `cua-driver`Prerequisites
macOS with Node.js >= 18.
Codex CLI (
codexinPATH, or bundled inside/Applications/ChatGPT.app).ChatGPT / Codex Desktop Computer Use already enabled on this Mac (this installs
/Applications/ChatGPT.app/Contents/Resources/cua_node/and~/.codex/computer-use/Codex Computer Use.appwith macOS Accessibility & Screen Recording permissions).(Optional, only needed for
codex-cu-bridge releaseUI fallback): Xcode Command Line Tools (swiftc) andcua-driverinstalled and granted macOS Accessibility / Screen Recording permissions.
This repository contains zero OpenAI binaries — it only speaks the documented
codex app-serverJSON-RPC protocol and officialSkyComputerUseClientCLI already installed on your machine.
Installation
git clone https://github.com/DASungta/codex-cu-bridge.git
cd codex-cu-bridge
# Install CLI launcher (~/.local/bin/codex-cu-bridge) & compile native menu inspector
./install.sh
# Or also symlink the Agent Skill into detected ~/.gemini, ~/.cursor, ~/.claude, ~/.agents dirs
./install.sh --skillsMake sure ~/.local/bin is on your PATH.
MCP Configuration (Antigravity / Cursor / Claude Code)
Add codex-cu to your MCP config file (e.g. ~/.gemini/config/mcp_config.json or ~/.cursor/mcp.json):
{
"mcpServers": {
"codex-cu": {
"command": "/Users/<you>/.local/bin/codex-cu-bridge",
"args": ["mcp"]
}
}
}Tip: When your agent has shell access (e.g. Antigravity, T3 Code, Claude Code), prefer the CLI (
codex-cu-bridge js ...) over MCP — it avoids per-call MCP serialization/schema overhead and runs in ~200–300 ms against the warm daemon.
Usage
Run JavaScript in cua_repl
Batch discovery, clicks, typing, loops, and final getAXState() into one call:
# List running macOS apps
codex-cu-bridge js 'const apps = await cua.listApps({emit:false}); nodeRepl.write(JSON.stringify(apps.filter(a=>a.isRunning).map(a=>({name:a.displayName,id:a.id}))));'
# Bind an app persistently across calls (use globalThis or var)
codex-cu-bridge js --title "Inspect Calculator" - <<'JS'
globalThis.calc = await cua.getApp("com.apple.calculator");
const ax = await globalThis.calc.getAXState({ emit: false, disableDiffing: true });
nodeRepl.write(ax.split("\n").slice(0, 20).join("\n"));
JSApp Allowlist Management
Config lives at ~/.config/codex-cu-bridge/allowlist.json and hot-reloads immediately:
codex-cu-bridge allow list
codex-cu-bridge allow add "com.apple.Notes"
codex-cu-bridge allow add "com.t3tools.*" # glob patterns supported
codex-cu-bridge allow remove "com.apple.Notes"
codex-cu-bridge allow deny "com.apple.systempreferences"
codex-cu-bridge allow mode allowlist # allowlist | ask | allow-allUnlisted or denied apps are cancelled (not permanently declined) and return [APPROVAL_REQUIRED] with the exact app name and bundle ID so the agent can ask you before allowing them.
Session Lifecycle & Cleanup
codex-cu-bridge end # Send cua_repl.turn_ended + SkyComputerUseClient turn-ended
codex-cu-bridge release # Dismiss macOS pink dot / Software Cursor (tries Sky notify first, falls back to UI)
codex-cu-bridge release Finder # Release only matching app(s) (preserves other concurrent sessions)
codex-cu-bridge release --dry-run # Inspect active Stop Using items without clicking
codex-cu-bridge release --all # Release all active Stop Using items
codex-cu-bridge reset # Reset persistent JS bindings in cua_repl
codex-cu-bridge status # Show daemon, codex app-server, touchedApps, and allowlist status
codex-cu-bridge docs # Print cached full cua_repl API docs
codex-cu-bridge stop # End active turn and stop background daemonEnvironment variables:
Variable | Default | Description |
|
| Codex configuration directory |
| auto-detected | Override path to |
|
| Seconds of inactivity before automatic |
|
| Seconds of inactivity before daemon auto-exits |
| auto-detected | Override path to |
macOS Cleanup Note (NSAppleEventsUsageDescription)
On macOS, Codex's official SkyComputerUseClient turn-ended helper bootstraps its XPC cleanup connection to SkyComputerUseService via Apple Events (kTCCServiceAppleEvents):
Hosts declaring
NSAppleEventsUsageDescription(e.g. T3 Code, Cursor, Terminal.app, iTerm2): macOS prompts once for Automation consent, after whichcodex-cu-bridge end(and the 20s idle timer) silently dismisses the menu bar pink dot andSoftware Cursor.Hosts missing
NSAppleEventsUsageDescription(e.g. standalone/Applications/Antigravity.appas of v2.35.1): macOStccdsilently refuseskTCCServiceAppleEventswithout prompting. Usecodex-cu-bridge release(or click the OpenAI menu bar icon →Computer Use→Stop Using <App>) when running inside such hosts, or run your agent inside T3 Code / Terminal.
Known Limitations
Native macOS apps only:
cua.getApp(...)works fully. Codex's turn-scoped browser plugin (cua.getTab/@oai/browser-desktop) requires an active Codex LLM turn and returnsCannot verify browser access without the current turnundermcpServer/tool/call. Use a DOM-native browser tool (Playwright / Chrome DevTools MCP) for web pages.macOS only: relies on macOS
SkyComputerUseServiceand CoreGraphics/Vision helpers.
Comparison with Related Projects
amontlabs/lcu: Full-featured decoupling layer with Chrome extension support, Touch ID approval management, and native Claude Code approval UI mods.
tmustier/codex-computer-use-mcp: MCP server + Pi adapter for the Codex Computer Use broker with browser support.
codex-cu-bridge(this repo): Minimalist, single-file, zero-npm-dependency bridge using only officialcodex app-serverJSON-RPC (mcpServer/tool/call), optimized for CLI-first agent speed, local JSON allowlist governance, and resilient macOS menu bar cleanup.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Build, run, inspect, and continue AgentScript workflows on connected Super Chrome and Mac clients.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables the execution of AppleScript and JavaScript for Automation (JXA) on macOS to control applications, system events, and shell commands. It provides native automation capabilities with a security layer that permits most operations while specifically blocking file deletion commands.16MIT
- AlicenseNot gradedqualityDmaintenanceProvides native macOS desktop automation for AI agents, enabling screen capture, mouse/keyboard control, window management, and iOS/Android simulator control in both foreground and background modes without focus stealing.6MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP agents to control macOS natively with shell, PTY, background Chrome automation, and Accessibility-based desktop control.4MIT
- AlicenseNot gradedqualityBmaintenanceEnables driving macOS apps from Claude Code — screenshots, accessibility trees, clicks, typing and keys — by borrowing the Computer Use eyes and hands from OpenAI's ChatGPT/Codex desktop app, with persistent JavaScript scripting, text-targeted batching, diff output and macros that collapse many actions into one call without consuming Codex quota or calling a model.2MIT