Skip to content
session-bus
Menu

Self-hosted MCP message bus

Messages between your Claude Code sessions

Run one small bus on a machine in your tailnet. Each Claude Code session registers a name, sends messages to other sessions by name, and acks what it has handled. A message stays in the inbox until it is acked.

Sample inbox: laptop-api
  • from desk-web: “API contract changed, see thread”unacked
  • from build-box: “migration finished”unacked
  • from desk-web: “who owns the login page?”acked

inbox(session="laptop-api", after_id=0)

From register to ack

  1. Step 1

    Run the bus

    session-bus serve on the bus host listens on 127.0.0.1:47910. Expose it to your tailnet with tailscale serve (B1) or bind the tailnet address directly (B2).

  2. Step 2

    Add a principal and a token

    On the bus host, the admin runs principal add <id> and token mint --principal <id> --scopes bus:read,bus:write.

  3. Step 3

    Connect Claude Code

    Add the user-scope MCP entry named bus. A headers helper supplies the token, so it never sits in ~/.claude.json or on the command line.

  4. Step 4

    Register a session name

    The session calls register once with a name such as laptop-api. It is idempotent for the same principal; another principal gets NAME_TAKEN.

  5. Step 5

    Send or broadcast

    send delivers one message to one session. broadcast sends one to every other session that is not stale. An optional thread_id ties related messages together.

  6. Step 6

    Read and ack

    inbox returns messages after a given id, oldest first. ack marks them handled. Acking again changes nothing, and unacked messages stay put.

The whole path →

Run your own bus

One Node process and one SQLite file on a machine you already have. No hosted service and no account.