REST API channel plugin for Claude Code. External applications can send messages into a running Claude Code session and receive replies back via HTTP.
External App (HTTP) ──POST──> CC-Bridge ──MCP──> Claude Code
<──reply── <──tool──
- AI-to-AI — ChatGPT or Codex calls Claude for help and gets a response back
- CI/CD — PR review comments, build failures, deploy events pushed to Claude in real time
- Agent chat room — multiple agents post to a shared channel, Claude watches and responds
- Event triggers — calendar events, cron jobs, monitoring alerts trigger Claude to act
Requires Bun and Claude Code v2.1.80+.
# Add the marketplace
/plugin marketplace add RecollectIQ/CC-Bridge
# Install the plugin
/plugin install bridge@cc-bridgeChannels are in research preview. Start Claude Code with the development flag:
claude --dangerously-load-development-channels plugin:bridge@cc-bridgeThe bridge starts an HTTP server on localhost:4111. If the port is taken, it auto-rotates to the next available port.
Send a message (fire-and-forget):
curl -X POST http://localhost:4111/channel/my-app \
-H 'Content-Type: application/json' \
-d '{"content": "Hello Claude!", "user": "my-app"}'Send and wait for Claude's reply (sync):
curl -X POST http://localhost:4111/channel/my-app \
-H 'Content-Type: application/json' \
-d '{"content": "What is 2+2?", "user": "my-app", "wait": true}'Send with a callback URL (async reply):
curl -X POST http://localhost:4111/channel/my-app \
-H 'Content-Type: application/json' \
-d '{"content": "Process this", "user": "my-app", "callback": "https://my-app.com/hook"}'| Method | Path | Description |
|---|---|---|
POST |
/channel/:channel_id |
Send a message to Claude |
GET |
/channels |
List active channels |
GET |
/openapi.json |
OpenAPI 3.1 spec (agent discovery) |
GET |
/docs |
Human-readable API docs |
GET |
/health |
Liveness check |
| Field | Type | Required | Description |
|---|---|---|---|
content |
string | yes | Message text |
user |
string | no | Sender identifier (default: "anonymous") |
callback |
string | no | URL to POST replies to |
meta |
object | no | Arbitrary metadata passed through to Claude |
wait |
boolean | no | Hold connection for sync reply (default: false, 120s timeout) |
The channel_id is any string you choose — channels are created on first use. Multiple callers can use the same channel safely; replies route by message_id, not channel.
When Claude replies, the message routes by the original request's message_id:
- Sync waiter —
wait: truerequest gets the reply as its HTTP response - Callback — reply is POSTed to the callback URL
- Fire-and-forget — Claude acts locally, no outbound delivery
Optional config files at ~/.claude/channels/bridge/:
.env
PORT=4111 # default
BIND_HOST=127.0.0.1 # default, localhost only
API_KEY= # empty = no auth
config.json — pre-configure channels with default callbacks:
{
"channels": {
"agent-room": {
"callback": "https://other-agent.local/inbox",
"description": "Multi-agent chat room"
}
}
}Optional. Set API_KEY in .env to require bearer token auth:
curl -X POST http://localhost:4111/channel/test \
-H 'Authorization: Bearer your-secret-key' \
-H 'Content-Type: application/json' \
-d '{"content": "hello"}'Auth is skipped for /health, /docs, and /openapi.json.
- Binds to
127.0.0.1by default (localhost only) - Optional bearer token auth
- No file access (minimal attack surface)
- Anti-injection instructions prevent config changes via channel messages
- Parent process watchdog prevents zombie servers after session ends
MIT