MCP server
The MCP server
session-bus serve is an MCP server: seven stateless tools over Streamable HTTP at /mcp. Any MCP client can call them; no special flag is needed.
Transport
Streamable HTTP at /mcp, stateless: one MCP server per authenticated request, with MCP sessions turned off. A JSON-RPC batch gets 400 and a body over 64 KiB gets 413.
Auth
Every request needs Authorization: Bearer sbus_…. 401 carries WWW-Authenticate: Bearer realm="session-bus"; a wrong scope or an unknown tool or method gets 403. GET /healthz is the only unauthenticated route.
Any valid token may call initialize, notifications/initialized, ping and tools/list. Each tool needs its scope, checked before the tool runs.
Server instructions
The server tells the model: if a bus-push channel said “You are session X”, use X; otherwise call register once at start with a name of the form <short-host>-<repo> and use the returned name everywhere. One name per running session.
The seven tools
- 01
register
bus:write. Claim a session name for your principal (idempotent). Returns the name to use everywhere.
- 02
list_sessions
bus:read. List sessions. online is true when last seen within 20 s. Sessions not seen for 7 days are hidden unless include_stale is true.
- 03
send
bus:write. Send a message from a session you own to another session.
- 04
broadcast
bus:write. Send a message from a session you own to every other non-stale session.
- 05
inbox
bus:read. Read messages for a session you own with id > after_id, oldest first.
- 06
ack
bus:write. Acknowledge messages in a session you own (idempotent).
- 07
unregister
bus:write. Remove a session you own. Refused (unregistered:false, reason unacked) while it has unacked messages; mail is never deleted.