Purpose
agent-bridge is a single-file MCP server that supports Windows only. It lets one AI coding agent list, read, and send messages to another agent's chat, enabling bidirectional collaboration between Claude and Codex. A typical use is Claude as the lead (PI) and Codex as the executor: Claude reads a long-running Codex chat, sends guidance mid-turn, and pauses, resumes, or rewrites Codex's goal.
Key capabilities
- Covers Codex (ChatGPT desktop app), the Code tab of the Claude desktop app, and headless Claude Code CLI sessions.
- Drives desktop apps via Windows UI Automation, filling the same input box and clicking the same buttons as the user, without spawning subprocess copies or hidden sessions; messages land in the chat the user is watching, with that chat's full context.
- Supports bidirectional operation: once registered in Codex, Codex can also hand work off to Claude sessions.
- Replies return automatically: when the caller is itself a desktop chat, the answer is typed into the caller's chat once ready.
- When sending a message, the bridge first switches the ChatGPT app to Codex mode, then opens the chat from the sidebar; it handles split windows; when the Codex chat is busy it shows Queue and Steer, and the bridge clicks Steer; after completion it restores the chat the user was originally viewing.
- Each send starts an independent monitor that waits for the turn to end in the transcript and stores the reply to
~/.agent-bridge/jobs/(location can be changed viaAGENT_BRIDGE_HOME). claude_cliruns headlessly asclaude -p --resume, using the passed permission_mode and stream-json mode (--input-format stream-json --output-format stream-json); the monitor holds the process and keeps its stdin open.- When sending a message to a running
claude_clichat, it does not start a second process but writes to the running process's stdin within about a second, usually received within the same turn; the task showsinto(the task id of that run), and both tasks receive the run's final result as the reply. Whensend_now=trueis set, the bridge also sends the CLI's send-now control so the current turn immediately yields to the message.
Usage
Requires Windows, Python 3.11+, and Codex (ChatGPT) and/or the Claude desktop app installed and signed in.
Register in Codex (~/.codex/config.toml); since replies may be slow, increase the tool timeout.
Other MCP clients: without uv, run pip install agent-bridge-mcp, then use agent-bridge-mcp as the command. Running from source:uvx --from git+https://github.com/EngMarchG/agent-bridge agent-bridge-mcp.
Example request: read my Codex chat "Implement milestones" in project bridges, tell me where it is stuck, and steer it to the failing test. The caller agent runs list_chats、read_chat and send_message, the answer will arrive in its chat after Codex completes the turn.
List and read operations open each app's own local files in read-only mode: Codex's SQLite state and rollouts, and Claude's session JSON and JSONL transcripts.
Limitations and safety
- Windows only; relies on UI Automation and the apps' current tabs and layout, and app updates may break it.
- It types into the real chat and briefly brings the app window to the foreground; do not type in the target window while sending.
- Run only one invocation at a time; parallel invocations drive the same UI and conflict, and file locks serialize invocations across processes.
- If sending fails with "no window found", the Chromium window's accessibility tree is not enabled; click the app once.
- The bridge will not accept "Trust this workspace?" on the user's behalf, nor overwrite an existing draft in the input box.
- Prompt injection risk exists: one agent's reply text becomes another agent's input, so treat agent chains with the same caution as any other untrusted input.
- Tests only check transcript parsing and do not touch any app.