Skip to content
RecollectIQPublic

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

CC-Bridge

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──

Use Cases

  • 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

Install

Requires Bun and Claude Code v2.1.80+.

# Add the marketplace
/plugin marketplace add RecollectIQ/CC-Bridge

# Install the plugin
/plugin install bridge@cc-bridge

Run

Channels are in research preview. Start Claude Code with the development flag:

claude --dangerously-load-development-channels plugin:bridge@cc-bridge

The bridge starts an HTTP server on localhost:4111. If the port is taken, it auto-rotates to the next available port.

Quick Start

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"}'

API

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

POST /channel/:channel_id

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.

Reply Routing

When Claude replies, the message routes by the original request's message_id:

  1. Sync waiter — wait: true request gets the reply as its HTTP response
  2. Callback — reply is POSTed to the callback URL
  3. Fire-and-forget — Claude acts locally, no outbound delivery

Configuration

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"
    }
  }
}

Authentication

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.

Security

  • Binds to 127.0.0.1 by 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

License

MIT

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages