HN 표시: 채널과 MCP를 사용하여 Claude Code와 Codex 간의 연결
hackernews
|
|
📦 오픈소스
#ai 딜
#ai 코딩 에이전트
#chatgpt
#claude
#claude code
#codex
#mcp
#openai
#채널
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
Claude Code의 신규 기능인 '채널'과 MCP(모델 컨텍스트 프로토콜)를 활용해, 두 AI 코딩 에이전트인 Claude Code와 Codex CLI 간의 실시간 양방향 대화를 구현하는 방법이 소개되었습니다. Codex의 MCP 툴 호출이 차단(blocking) 방식으로 동작하는 점을 이용해, Codex가 메시지를 보내면 Claude가 응답할 때까지 연결을 유지하며 대화를 주고받는 비대칭 브리지를 구축합니다. 이 프로젝트는 웹 UI를 통해 두 에이전트 간의 대화 과정을 실시간으로 시각화할 수 있는 환경을 제공합니다.
본문
Uses Claude Code Channels for push notifications on Claude's side and a blocking MCP tool on Codex's side. Two AI coding agents. One conversation. Real-time web UI to watch it happen. Claude Code and Codex CLI are both great coding agents, but they don't expose a native symmetric chat protocol between each other. Plain MCP is request-response, not push-to-both-live-sessions. A2A (Google's agent protocol) isn't supported natively by either tool. There's no off-the-shelf way to make the two agents hold a live conversation. Claude Code recently shipped Channels, a way to push messages into a running session from an MCP server. This project uses that as the push mechanism on Claude's side, and a blocking MCP tool call on Codex's side, to create a practical bidirectional bridge between the two. 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 a bit to return. From Claude's perspective it's a channel notification. The bridge sits in between, routing messages and showing them in a web UI. In practice, Codex-initiated turns feel real-time and two-way. This is not symmetric push in both directions though: Claude can reply immediately to a pending Codex request, but Claude-initiated messages still wait until Codex polls or makes another request. - Bun (check with 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 git clone https://github.com/abhishekgahlot2/codex-claude-bridge.git cd codex-claude-bridge bun install Add codex-bridge to your Claude Code MCP config. Open ~/.mcp.json (create it 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 wherever you cloned the repo. Add the Codex-side MCP server 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 needed because send_to_claude can wait for Claude's reply for about 2 minutes. The default 60s timeout will kill the connection too early. 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: 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. Go to http://localhost:8788 in your browser. This is where you watch the conversation happen. Start the conversation from Codex's side. Tell Codex something like: Use Claude bridge to discuss whether we should use Redis or Memcached for caching. Keep going until you agree. Codex calls send_to_claude() , the bridge pushes it to Claude via a channel notification, Claude processes it and replies, and the bridge returns Claude's reply to Codex. Codex can keep calling send_to_claude() to continue the discussion. This means the smooth path is Codex -> Claude -> Codex. It behaves like a live back-and-forth conversation, even though the overall bridge is still asymmetric under the hood. You can also type in the web UI as a human observer — your messages go straight to Claude's session. The web UI at localhost:8788 shows all messages in real time: - Purple bubbles on the left = Claude - Green bubbles on the right = Codex - Gray bubbles = you (human observer) Claude has a send_to_codex tool, but since Codex can't receive push notifications, the message sits in a queue until Codex polls for it. That's why the Codex-initiated flow is the smoother and more real-time path. | File | What it does | |---|---| server.ts | Claude Code channel plugin. MCP server over stdio, web UI, and HTTP API endpoints for the Codex side. | codex-mcp.ts | Codex CLI MCP server. Exposes send_to_claude() and check_claude_messages() . Talks to server.ts over HTTP. | .mcp.json | Plugin config for Claude Code's plugin system. | .claude-plugin/plugin.json | Plugin metadata. | | Env var | Default | What it does | |---|---|---| CODEX_BRIDGE_PORT | 8788 | Port for the web UI and internal API | CODEX_BRIDGE_URL | http://localhost:8788 | URL the Codex-side MCP server uses to reach the bridge | MCP works as part of the transport here, but by itself it's request-response. One agent can call the other as a tool, but neither side gets a native symmetric push channel into the other's live session. A2A (Google's Agent-to-Agent protocol) would be a cleaner fit in theory, but neither Claude Code nor Codex exposes native A2A or ACP integration today. Community bridges usually end up wrapping those protocols in MCP anyway. Claude Code Channels are the only push mechanism either tool exposes today for this setup. This bridge uses channels on Claude's side and a blocki
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유