Skip to content

Cross-AI IPC: let OpenClaw sessions talk to Claude Code, Codex, and external tools #55872

Description

@47Liu

Problem

OpenClaw's sessions_send works great within a single Gateway, but there's no way for an OpenClaw agent to communicate with AI tools running outside OpenClaw — Claude Code sessions, OpenAI Codex, CI pipelines, or custom scripts.

Related issues: #53945 (cross-gateway), #55061, #43605

Proposal: xihe-jianmu-ipc as an MCP bridge

We built and tested xihe-jianmu-ipc — a lightweight WebSocket message hub that routes messages between any AI sessions. It ships as an MCP server, so OpenClaw can load it natively with zero code changes.

How it works

OpenClaw Gateway          Claude Code           Codex / curl / scripts
  (MCP client)            (MCP client)          (HTTP POST)
       │                       │                       │
       └───── WebSocket ───────┼───── WebSocket ───────┘
                               │
                    ┌──────────▼──────────┐
                    │  xihe-jianmu-ipc    │
                    │  Hub (localhost:3179)│
                    └─────────────────────┘

Tested integration (zero config on OpenClaw side)

Add to openclaw.json:

{
  "mcp": {
    "servers": {
      "jianmu-ipc": {
        "command": "node",
        "args": ["/path/to/xihe-jianmu-ipc/mcp-server.mjs"],
        "env": { "IPC_NAME": "openclaw" }
      }
    }
  }
}

The agent immediately gets these tools:

  • ipc_send(to, content) — send to any connected session
  • ipc_sessions() — list all online sessions
  • ipc_subscribe(topic) — topic pub/sub
  • ipc_whoami() — session identity

Verified bidirectional communication

We tested the full round-trip on Windows 11 + WSL2:

Direction 1: OpenClaw → Hub → Claude Code

# From OpenClaw (WSL2), send to Claude Code (Windows)
curl -X POST http://<host>:3179/send \
  -H "Content-Type: application/json" \
  -d '{"from":"openclaw","to":"claude-main","content":"IG cookie expired"}'
# Claude Code receives via Channel push notification — instant

Direction 2: Claude Code → Hub → OpenClaw

# Hub auto-routes to OpenClaw via /v1/chat/completions API
# OpenClaw replies: "好的,cookie 已更新。请问需要我重试什么操作?"
# Hub forwards reply back to Claude Code

What this enables

Scenario How
OpenClaw detects login failure → alerts developer's Claude Code session ipc_send(to="main", content="IG login expired")
Developer in Claude Code deploys → notifies OpenClaw to restart tasks ipc_send(to="openclaw", content="config updated, rebuild cron")
Multiple OpenClaw gateways coordinate via shared Hub Both load MCP server, communicate through Hub
CI pipeline notifies agents curl POST /send — no SDK needed
Codex completes task → reports to OpenClaw HTTP API, universal access

Security

  • Token authentication (IPC_AUTH_TOKEN) — disabled by default for local dev, required for production
  • /health endpoint accessible without auth (for monitoring)
  • OpenClaw's existing sendPolicy and visibility rules still apply on the OpenClaw side

Details

Happy to discuss integration approaches or contribute upstream.

xihe-forge

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions