Skip to main content
Glama

Gemini for Mac & Antigravity CLI Computer Use MCP

English | 简体中文

One-command macOS setup to enable codex-computer-use-mcp (cua_repl) for both Gemini for Mac (via a zero-dependency loopback HTTP-to-stdio MCP bridge for macOS App-Sandboxed apps) and Antigravity CLI (direct native stdio).

Client

Transport

One-command setup

Gemini for Mac

Loopback HTTP gateway + lightweight stdio bridge

bash scripts/install.sh

Antigravity CLI

Direct native stdio (~/.gemini/config/mcp_config.json)

bash scripts/install-antigravity.sh


Why direct stdio fails in Gemini for Mac

Adding codex-computer-use-mcp directly as a Local MCP (stdio) server in Gemini for Mac fails during initialization with:

EPERM: operation not permitted, lstat '/Applications'

/Applications/Gemini.app runs inside a strict macOS App Sandbox (com.apple.security.app-sandbox). Any stdio child process spawned by Gemini inherits that sandbox and cannot inspect /Applications/ChatGPT.app or launch the signed Computer Use components (codex / node_repl / SkyComputerUseService)—even if you grant Full Disk Access or Accessibility in System Settings.


Related MCP server: VBridge

How it works

This bridge splits codex-computer-use-mcp into two zero-dependency Node.js 22+ layers:

flowchart LR
    G["Gemini for Mac<br/>(App Sandbox / Default)"] -->|"stdio JSON-RPC"| B["bridge.sh / bridge.mjs<br/>Only needs ~/.local + ~/.nvm + loopback HTTP"]
    B -->|"HTTP POST 127.0.0.1:18765/mcp<br/>Bearer Token Auth"| S["server.mjs<br/>macOS LaunchAgent (unsandboxed)"]
    S -->|"stdio"| M["codex-computer-use-mcp<br/>(cua_repl: js / js_reset)"]
    M -->|"Signed runtime"| Mac["macOS Apps & Browsers"]
  • Server (src/server.mjs): Runs as a user LaunchAgent, binds strictly to 127.0.0.1:18765, requires a 0600 random Bearer token, exposes standard MCP Streamable HTTP (POST /mcp, GET /mcp SSE stream with keepalive, DELETE /mcp, Mcp-Session-Id), and hosts codex-computer-use-mcp.

  • Bridge (src/bridge.mjs / bridge.sh): A tiny stdio-to-Streamable-HTTP forwarder for Gemini for Mac (whose Cloud MCP tab only accepts remote HTTPS/OAuth URLs). It only reads ~/.local/share/cua-http-mcp/token and talks to 127.0.0.1:18765/mcp, which works out of the box with Gemini's Default sandbox setting (~/.local, ~/.nvm, and outbound network are allowed by default). No app patching or sandbox disabling required.


Prerequisites

  1. macOS with an unlocked GUI user session

  2. Node.js >= 22

  3. Official ChatGPT macOS app opened at least once with its Computer Use component enabled (see codex-computer-use-mcp requirements)

  4. macOS Accessibility and Screen Recording permissions granted as required by Computer Use


Quick Start

git clone https://github.com/the-waste-land/gemini-mac-computer-use-bridge.git
cd gemini-mac-computer-use-bridge

Option 1: Gemini for Mac

bash scripts/install.sh

The installer checks Node >= 22, installs (or reuses) codex-computer-use-mcp, generates a 0600 Bearer token, installs & loads ~/Library/LaunchAgents/com.local.cua-http-mcp.plist, and runs an end-to-end self-test (initialize → tools/list → computer_use_status).

Then in Gemini for Mac:

  1. Open More → Customize → Connectors → Custom → Local MCP

  2. Fill in:

    • Server Name: cua-bridge

    • Description: Local Computer Use MCP via loopback HTTP bridge

    • Command: /Users/<you>/.local/share/cua-http-mcp/bridge.sh (printed by install.sh)

    • Sandbox settings: keep Default

  3. Click Next → accept consent → Connect

  4. Verify in a new chat:

    @cua-bridge call computer_use_status and js (await cua.listApps()) to list my running macOS apps
IMPORTANT

If you previously addedcodex-computer-use-mcp directly as a Local MCP (e.g. computer-use), remove that old entry in Gemini for Mac. A sandbox-blocked direct MCP entry can hang during initialization and cause Gemini's entire MCP tool discovery to time out (25s), blocking @cua-bridge as well.

TIP

Override port or Node path if needed:CUA_BRIDGE_PORT=18765 CUA_NODE_BIN=/path/to/node bash scripts/install.sh

Option 2: Antigravity CLI

bash scripts/install-antigravity.sh

Since Antigravity CLI runs in an unsandboxed terminal, it connects over native stdio directly. The script backs up and merges computer-use into ~/.gemini/config/mcp_config.json and runs an end-to-end stdio self-test. Open a new Antigravity CLI session to use js, js_reset, and computer_use_status.


Security Model

  • The HTTP gateway binds strictly to 127.0.0.1 (never exposed to LAN or public networks).

  • Every /mcp request requires Authorization: Bearer <token> stored at ~/.local/share/cua-http-mcp/token (dir 700, file 600).

  • Neither /Applications/Gemini.app nor macOS SIP/App Sandbox is modified.

  • Computer Use grants direct UI control over your desktop and browsers—use only on your personal trusted Mac.


Operations & Uninstall

# Check gateway health
curl -s http://127.0.0.1:18765/health

# View logs
tail -n 30 ~/.local/share/cua-http-mcp/server.log ~/.local/share/cua-http-mcp/server.err.log

# Restart background gateway
launchctl kickstart -k "gui/$(id -u)/com.local.cua-http-mcp"

# Clear lingering Computer Use software cursor if needed
pkill -f MacOS/SkyComputerUseService

# Uninstall
bash scripts/uninstall.sh                        # Gemini for Mac bridge + LaunchAgent
bash scripts/install-antigravity.sh --uninstall  # Antigravity CLI config entry

Credits

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    • Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.

    • Securely control computers you explicitly pair through files, terminals, processes, screenshots, desktop UI/input, clipboard, browser automation, diagnostics, and document tools.

      https://remcp.site/mcp
    • EXZA Remote — AI Computer Commander Your computer. Your control. Securely connect your own macOS, Windows or Linux computer to compatible AI clients, including ChatGPT and Claude. EXZA Remote provides 59 MCP tools for authorized file management, terminal operations, system monitoring, desktop automation and email workflows. GETTING STARTED 1. Create an EXZA Remote account. 2. Install the official computer connection client. 3. Pair your device using a temporary six-digit PIN. 4. Approve the connection on your computer. 5. Connect your preferred MCP client using EXZA OAuth. MCP ENDPOINT https://remote.exza.de/mcp TRANSPORT Streamable HTTP with OAuth 2.0 KEY FEATURES • 59 MCP tool interfaces • Secure computer and file access • Terminal commands and background jobs • File search, reading and editing • System monitoring and desktop automation • macOS, Windows and Linux support • Owner-controlled permissions and approvals COMPLETE INSTALLATION & DOCUMENTATION Detailed setup instructions, terminal installation commands, all 59 tools, troubleshooting and security information: https://github.com/exzade/EXZA-Remote/blob/main/docs/GLAMA_OVERVIEW.md Official website: https://remote.exza.de EXZA Remote is an independent, OAuth-protected service. Computer access requires individual account authorization and device-owner approval.

      https://remote.exza.de/mcp
    • Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.

      https://mcp.getshellway.com/mcp

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI services like Claude and Cursor to remotely control a Mac by executing shell commands, managing files, and running AppleScript for UI automation. Access is secured through OAuth 2.0 authentication and encrypted tunnels to protect remote interactions.
      2
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables authorized remote MCP clients to securely reach local Mac or Windows tools over OAuth, including shell commands, file read/write, background jobs, screenshots, UI control, and clipboard access. It can also expose configured Desktop MCP servers and optional Claude Code task delegation.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Exposes a secure OAuth2 + SSE Model Context Protocol endpoint that lets Gemini Web read a local project's files, directory trees, search results, git status/diffs, and workspace info on a read-only basis. It also pairs the browser-side automation with a local bridge daemon so prompts and answers flow both ways between Gemini Web and Google Antigravity.
      2
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables web-based AI clients such as Claude, ChatGPT, Grok, and Postman to securely operate a local machine through a single OAuth-gated MCP endpoint exposing 38 governed tools. Covers file read/write/edit, whitelisted shell commands, search, Git, SQLite, browser automation, DevTools, background tasks, localhost fetching, clipboard, notifications, port management, and Postman control.
      MIT