Harnesses
Connect Mobile Agent to OpenCode, Antigravity, or Claude Code running on a computer and continue those sessions from the phone.
A harness is a coding agent that runs somewhere else — a laptop, desktop, or server — with its own models, tools, and project files. Mobile Agent can connect to a harness and become its mobile client: you browse its sessions, send prompts, watch tool calls, approve permissions, and attach files, all from the phone.
The harness keeps its own credentials and runtime. Mobile Agent never stores your OpenCode, Antigravity, or Claude login.
Supported harnesses
| Harness | Connection | Notes |
|---|---|---|
| OpenCode | OpenCode V2 server URL, or a pairing QR/link | Supports device sharing: the harness can call your phone's tools through MCP. |
| Antigravity | ACP bridge (agy acp) | Default bridge port 7801. Sign in on the host with agy acp --login. |
| Claude | ACP bridge (@agentclientprotocol/claude-agent-acp) | Default bridge port 7802. Sign in on the host with claude auth login, or set ANTHROPIC_API_KEY. |
Both Antigravity and Claude speak the Agent Client Protocol (ACP) through a small HTTP/SSE bridge provided by the Mobile Agent repository.
What you can do with a harness session
- Browse the harness's sessions from the OpenCode sessions sidebar item (for OpenCode) or the harness screen.
- Start a session and send prompts from the phone.
- Watch streamed reasoning, messages, and tool calls.
- Respond to permission requests raised by the host agent.
- Attach images and files; attachments are uploaded to the harness host.
- Switch the model or agent the harness exposes.
- Share the phone's folder, files, media, and skills with the harness through Device Sharing.
Install the ACP bridges
On the computer that has agy and/or the Claude ACP adapter installed, run:
curl -fsSL https://raw.githubusercontent.com/tecnicalbot/mobile-agent/main/tools/install.sh | sh
mabridgeThe installer:
- Uses an existing Node.js 22+ install, or downloads a portable copy.
- Downloads the single-file bridge to
~/.mobile-agent/bridge.mjs. - Creates a stable token at
~/.config/mobile-agent/bridge-token(or%APPDATA%\mobile-agent\bridge-tokenon Windows). - Adds a short
mabridgecommand to yourPATH. - Optionally installs a terminal QR renderer.
mabridge starts both bridges on the LAN, binds to 0.0.0.0, and prints a one-time pairing QR in the terminal. The code expires after five minutes and can be used once. One scan configures every harness advertised in the QR.
Useful flags:
mabridge --no-pair # print URLs and token instead of a QR
mabridge --only antigravity # start only Antigravity
mabridge --only claude # start only Claude
mabridge --update # refresh bridge.mjsManual single-file download is also supported:
curl -fsSL https://raw.githubusercontent.com/tecnicalbot/mobile-agent/main/tools/acp-bridge/bridge.mjs \
-o mobile-agent-bridge.mjs
node mobile-agent-bridge.mjs --harness all --lan --pairThe bridge keeps running in the foreground until you press Ctrl+C.
Host sign-in
- Antigravity: run
agy acp --loginonce on the bridge host. The app never receives Antigravity credentials. - Claude: run
claude auth loginon the bridge host to use a Claude subscription, or start the bridge withANTHROPIC_API_KEY=...to use Console billing. Distributed or shared deployments should use API-key authentication.
Connect from the app
- Open Settings → Harnesses.
- Choose OpenCode, Antigravity, or Claude.
- Either scan the pairing QR or enter the connection manually.
For ACP harnesses, manual setup asks for:
- Bridge URL — the computer's LAN address and port, e.g.
http://192.168.1.20:7801. - Token — the stable token printed by the bridge, also stored at
~/.config/mobile-agent/bridge-tokenon the host. - Working directory — optional; blank uses the bridge default.
For OpenCode, manual setup asks for:
- Server URL — the OpenCode V2 server, e.g.
http://192.168.1.20:4096. - Username and password — the server's credentials. The default username is
opencode; the password is optional when the server has none. - Working directory — optional.
You can also paste an OpenCode pairing link (…/auth/connect/…) instead of scanning it.
Address tip: use
127.0.0.1orlocalhostonly when the server or bridge runs in Termux on the same phone. For a computer, use that computer's LAN IP. For internet access, put the bridge behind HTTPS or a private tunnel rather than exposing plain HTTP.
Device sharing
Each harness panel can attach the phone as an MCP server. This lets the host agent list and read shared folders, use app files and media, and load enabled skills. Every phone tool call still requires your approval on the phone, including reads. See Device Sharing.
Security
- Harness credentials stay on the harness host. The app stores only the bridge URL and token.
- The bridge token is shared across harnesses but is never shown in the QR; the QR contains a short-lived, single-use pairing code.
- Use the LAN only on a network you trust, and prefer HTTPS or a VPN/tunnel for remote access.
- Permission requests from the harness appear in the app and are subject to the same review you would give a local agent.
Troubleshooting
- QR expired — run
mabridgeagain to print a fresh code. Codes last five minutes. - Can't reach the bridge — confirm the bridge is still running, the phone and computer are on the same network, and the URL uses the computer's LAN IP.
- 401 or auth errors — re-copy the token from the host, or pair again.
- Harness shows signed out — sign in on the host (
agy acp --loginorclaude auth login) and tap refresh in the app. - OpenCode says V2 is required — update the OpenCode server; the app talks to the V2 API.