agent-bridge
Enables OpenAI Codex sessions to communicate with Claude Code and opencode peers, delegate headless tasks, spawn background subagents, exchange threaded messages, and coordinate multi-agent workflows through agent-bridge.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-bridgeAsk Codex to review the diff in src/auth and wait for its answer."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent-bridge
Let Claude Code, OpenAI Codex and opencode talk to each other.
agent-bridge is a set of plugins for Claude Code, Codex and opencode, built on a shared core. Agents on the same machine can:
Message each other live. A Claude Code session and a Codex session send each other questions, reviews and results. Replies are threaded, and messages to an agent that is offline wait for it.
Delegate.
ask_<agent>runs another agent headlessly for a one-off task and returns its answer; for exampleask_codexandask_opencodefrom Claude, orask_claudefrom Codex. You can continue that session later.Spawn each other as subagents.
spawn_codex/spawn_claudestart the other agent in the background and return immediately. The result arrives later as a message, and several subagents can run in parallel.Pick any model.
ask_*andspawn_*accept any model id or alias the target CLI accepts, for examplegpt-6-sol,opus, or a full Claude model id. Ids are passed through verbatim, so new models work without a plugin update.
Claude Code session Codex session
┌─────────────────────────┐ ┌─────────────────────────┐
│ agent-bridge MCP server │◄──── local pipe ────►│ agent-bridge MCP server │
│ + channel push / hooks │ \\.\pipe\… or .sock │ + hooks / codex queue │
└─────────────────────────┘ │ └─────────────────────────┘
the first server to start is the broker; messages persist in SQLiteThere is no daemon to install. Each agent starts its own MCP server. The first one to start binds a Windows named pipe (or a Unix domain socket on macOS/Linux) and acts as the broker. If that process exits, another server takes over automatically. All messages are stored in SQLite under ~/.agent-bridge, so nothing is lost when a peer is offline or the broker changes.
Requirements
Node.js 22.13+ (uses the built-in
node:sqlite)Claude Code (with plugin support) and/or Codex CLI (with plugin support; tested with 0.156)
Related MCP server: claude-intercom-mcp
Install
Claude Code
claude plugin marketplace add rennerdo30/agent-bridge
claude plugin install agent-bridge@agent-bridgeCodex
codex plugin marketplace add rennerdo30/agent-bridge
codex plugin add agent-bridge@agent-bridgeCodex does not run plugin hooks until you trust them. Open /hooks in a Codex session once and trust the agent-bridge hooks. Without them, messages are only visible when Codex calls the inbox tool.
opencode
npx -y github:rennerdo30/agent-bridge install-opencodeThis copies the plugin into opencode's global config (~/.config/opencode/plugins/, plus a skill). Restart opencode afterwards. It needs Node.js 22.13+ on PATH. Remove it with npx -y github:rennerdo30/agent-bridge uninstall-opencode.
In opencode the tools are called bridge_peers, bridge_send, bridge_ask_claude, bridge_spawn_codex, and so on. Because opencode plugins can start turns themselves, opencode receives peer messages live, even while idle, whenever its listen window or auto-wake applies.
Usage
Just ask in plain language, for example:
Ask Codex to review the diff in
src/authand wait for its answer.
Send the Codex session a summary of the API we agreed on.
Get a second opinion from Claude on this migration plan. (from Codex)
Tools (both agents)
Tool | What it does |
| Who is online, your own name, delivery mode and auto-wake status |
| Message a peer: |
| Block until a (matching) message arrives, e.g. the answer to your question |
| Read unread messages |
| Headless delegation to another agent (every agent gets the other two); waits and returns the answer and a |
| Same, but as a background subagent: returns a job name at once; the result arrives as a message from |
| Stop a running background subagent |
| Let incoming messages make this session keep working (see below) |
ask_* and spawn_* take these optional parameters:
model: any id or alias the target accepts, passed through verbatim. opencode usesprovider/model.session_id,cwd,timeout_sec.One target-specific option:
sandboxfor Codex,permission_modefor Claude, orauto_approvefor opencode. Headless opencode rejects every permission request unlessauto_approveis set.
Peer names default to <agent>-<project folder>, for example codex-myrepo. Set AGENT_BRIDGE_NAME or the name option in the config file to choose your own.
How messages reach a session
Claude Code | Codex | |
While the agent is working | injected after each tool call ( | same |
On your next prompt | injected ( | same |
When the agent finishes a turn (auto-wake on) |
| same |
While the session is idle | live push via channel (see below) | auto-wake runs |
opencode receives messages through its plugin: after each model step while it works, and by starting a turn itself when it is idle.
Live push into Claude Code (channels)
Claude Code channels let the agent-bridge MCP server push peer messages straight into a running session, even an idle one. Channels are a research preview, and custom channels must currently be loaded with the development flag:
claude --dangerously-load-development-channels plugin:agent-bridge@agent-bridgeagent-bridge detects this flag on its parent process and switches to channel delivery automatically. You can force a mode with AGENT_BRIDGE_DELIVERY=channel|hooks.
Listen window
After a session sends a bridge message or spawns a subagent, its Stop hook keeps the turn open for up to lingerSec seconds (default 300) waiting for the reply. If a reply arrives, the agent continues with it; otherwise the turn ends normally. This keeps a back-and-forth going without you nudging either agent, and needs no auto-wake. Press Esc to stop listening early, or set lingerSec to 0 to disable it.
Auto-wake and loop protection
Auto-wake is off by default. Turn it on per session by asking the agent ("turn on agent-bridge auto-wake"), or globally with "autoWake": true in the config.
Every reply increments a conversation's hop count. Messages at or above maxHops (default 6) never wake an agent; they are still shown on the next prompt. Delegated headless sessions cannot delegate again.
Configuration
~/.agent-bridge/config.json (all keys optional; per-agent sections override the top level; env vars override both):
{
"autoWake": false,
"maxHops": 6,
"lingerSec": 300,
"codex": { "name": "codex-main", "claudeBin": "claude", "claudePermissionMode": "default", "claudeModel": "opus" },
"claude": { "delivery": "auto", "codexBin": "codex", "codexSandbox": "read-only", "codexModel": "gpt-6-sol" },
"opencodeModel": "anthropic/claude-sonnet-5",
"opencodeAutoApprove": false
}Env var | Meaning |
| Data directory (default |
| Peer name |
|
|
| Loop limit |
| Listen window after sending (0 disables) |
| Claude only: |
| Paths of the CLIs used for delegation |
| File log level: |
| stderr log level (default |
| Override the pipe / socket path |
Logs are written to ~/.agent-bridge/logs/agent-bridge.log.
CLI
The plugins bundle a small CLI for debugging:
node <plugin>/dist/cli.mjs status # broker and connected peers
node <plugin>/dist/cli.mjs send codex "hi" # send as peer "cli"
node <plugin>/dist/cli.mjs tail # print messages addressed to "cli"
node <plugin>/dist/cli.mjs pathsTroubleshooting
Console windows flash on Windows while Codex works. This happens when Codex runs your session inside its background app-server daemon: that process has no console, so Windows opens a new window for every
gitornodeprocess it starts. Adddaemon_auto_start = falseunder[features]in~/.codex/config.toml, runcodex app-server daemon stop, and restart Codex.A peer shows up as plain
codexwith the plugin folder as its cwd. Codex hasn't reported the project directory yet. It does so on the first hook or tool call; make sure the hooks are trusted in/hooks.Messages to an idle agent are not answered. An idle session only sees messages on its next prompt, unless it's in its listen window, auto-wake is on, or (for Claude) channels are enabled.
Security notes
The pipe and socket are local to your user account. On Unix the socket lives in your home directory; on Windows the named pipe name is derived from your data directory.
Peer messages are presented to the model as coming from another agent, not from you. The model is told not to take destructive actions only because a peer asked.
Delegated Codex runs are
read-onlyby default. Delegated Claude runs use thedefaultpermission mode, which cannot approve anything in headless mode. Raise these only if you trust the task.
Development
npm install
npm run check # typecheck + tests + buildnpm run build bundles src/ into plugins/*/dist (committed, so plugins work straight from git).
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
End-to-end encrypted messaging and work coordination for autonomous AI agents.
The team layer for AI coding agents: shared contracts, collision alerts, E2EE sessions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables discovery and instant communication between multiple local Claude Code instances running across different projects. It allows agents to list active peers, share work summaries, and send messages through a local broker daemon.16 npm2,210MIT
- AlicenseAqualityBmaintenanceEnables local messaging between Claude Code, Codex, Pi, and other coding-agent sessions on the same machine, allowing them to discover each other, send updates, ask questions, and reply.814 npm2AGPL 3.0
- AlicenseAqualityBmaintenanceEnables local AI coding agents to message each other on one machine using a durable SQLite mailbox and live-ask tools.9MIT
- AlicenseNot gradedqualityAmaintenanceEnables bidirectional messaging between Claude Code and Codex Desktop through a SQLite-backed bus, so messages sent from either side appear in the other's chat pane, with acknowledgement and redelivery semantics.23 npmMIT