Bridge Claude Code and Codex CLI for Multi-Agent Conversations

Bridge Claude Code and Codex CLI for Multi-Agent Conversations

Use this open-source MCP bridge to make Claude Code and Codex CLI hold real-time conversations, enabling collaborative problem-solving between two AI coding agents.

Ggentic.news Editorial·1d ago·3 min read·19 views·via hn_claude_code, reddit_claude, gn_mcp_protocol
Share:

Bridge Claude Code and Codex CLI for Multi-Agent Conversations

What It Does

This open-source project creates a practical bidirectional bridge between Claude Code and Codex CLI using Claude's new Channels feature and MCP (Model Context Protocol). It solves a specific problem: while both are excellent coding agents, they don't natively support symmetric chat protocols with each other. Plain MCP is request-response, and Google's A2A agent protocol isn't supported by either tool.

The bridge uses Claude Code's Channels (recently shipped) as the push mechanism on Claude's side and a blocking MCP tool call on Codex's side. When Codex calls send_to_claude(), the bridge holds the connection open until Claude replies. From Codex's perspective, it's a tool call that takes time to return. From Claude's perspective, it's a channel notification. The bridge sits between them, routing messages and displaying them in a real-time web UI at http://localhost:8788.

Setup Requirements

You'll need:

  • Bun (bun --version - install from bun.sh if missing)
  • Claude Code v2.1.80+ with a claude.ai account
  • Codex CLI with an OpenAI API key or ChatGPT login

Codex Bridge UI showing a live multi-turn exchange between Codex and Claude

Installation & Configuration

git clone https://github.com/abhishekgahlot2/codex-claude-bridge.git
cd codex-claude-bridge
bun install

1. Configure Claude Code MCP:
Open ~/.mcp.json (create if it doesn't exist) and add:

{
  "mcpServers": {
    "codex-bridge": {
      "type": "stdio",
      "command": "bun",
      "args": ["/full/path/to/codex-claude-bridge/server.ts"]
    }
  }
}

Replace /full/path/to with your actual clone location.

2. Configure Codex CLI:
Add to ~/.codex/config.toml:

[mcp_servers.codex-bridge]
command = "bun"
args = ["/full/path/to/codex-claude-bridge/codex-mcp.ts"]
tool_timeout_sec = 120

The tool_timeout_sec = 120 is crucial because send_to_claude() can wait for Claude's reply for up to 2 minutes. The default 60-second timeout would kill the connection prematurely.

Running the Bridge

Start Claude Code with development channels:

claude --dangerously-load-development-channels server:codex-bridge

You should see Listening for channel messages from: server:codex-bridge in the output.

In a separate terminal, start Codex:

codex

Codex will auto-load the codex-bridge MCP server from your config. Verify by running /mcp inside Codex — you should see codex-bridge listed with send_to_claude and check_claude_messages tools.

Open the web UI:
Navigate to http://localhost:8788 in your browser to watch the conversation unfold.

How To Use It

Start the conversation from Codex's side with a prompt like:

Use Claude bridge to discuss whether we should use Redis or Memcached for caching. Keep going until you agree.

Codex will call send_to_claude(), the bridge pushes it to Claude via a channel notification, and Claude can reply immediately to the pending Codex request. The conversation continues back and forth.

Current Limitations

This implementation isn't perfectly symmetric push in both directions. While Claude can reply immediately to a pending Codex request, Claude-initiated messages still wait until Codex polls or makes another request. In practice, Codex-initiated turns feel real-time and two-way, making it practical for collaborative problem-solving sessions.

Why This Matters

This bridge demonstrates the power of Claude Code's Channels feature for creating interactive, multi-agent workflows. It's not just about connecting two AI tools — it's about creating new collaborative patterns where different AI agents with different strengths can work together on complex problems.

For developers who regularly use both Claude Code and Codex CLI, this bridge eliminates the copy-paste shuffle between sessions and creates a unified conversation history that both agents can reference.

AI Analysis

Claude Code users should install this bridge immediately if they also use Codex CLI. The setup takes 5 minutes but enables a fundamentally different workflow: collaborative AI problem-solving. Instead of manually copying context between tools, you can now have Claude and Codex debate architectural decisions, review each other's code, or brainstorm solutions together. Specific workflow change: When facing a complex technical decision, start both agents in conversation mode. Have them argue different approaches while you watch in the web UI. This gives you multiple AI perspectives without context switching. The agents can reference their entire conversation history, creating a more coherent discussion than you'd get by asking each separately. Important configuration note: Don't skip the `tool_timeout_sec = 120` setting in Codex's config. The bridge needs longer timeouts than typical MCP tools because it's waiting for human-like conversation timing between agents.
Original sourcegithub.com

Trending Now

More in Products & Launches

View all