Transports

How MCoP messages travel over HTTP with Server-Sent Events, WebSocket and gRPC, and how a client finds a server.

MCoP defines one set of messages (Base protocol) and three bindings. Every binding MUST carry the same messages, in the same order, and pass the same conformance suite.

Discovery

A server MAY publish its transports at a well-known path. The document needs no authentication and holds no secret:

GET /.well-known/robotelos
{
  "protocol_versions": ["1"],
  "transports": [
    {"transport": "ws", "url": "ws://127.0.0.1:8787/v1/ws"},
    {"transport": "sse", "url": "http://127.0.0.1:8787"},
    {"transport": "grpc", "url": "127.0.0.1:8788"}
  ]
}

A client that knows only the server’s base address SHOULD read this document to find the other bindings.

A server MAY also state what it is, with two optional fields. environment is one of local, dev, stg or prod. effects_mode is sandbox when the effects of its agents are simulated, or real. A server that leaves a field out does not state it. The protocol gives the absence no value; a client that must be careful, such as a test runner that could do harm to a real system, decides for itself how to treat an unstated target, and it is advised to treat it as production.

{"protocol_versions": ["1"], "transports": [], "environment": "stg", "effects_mode": "sandbox"}

Authentication

Every binding authenticates the connection with a bearer token. The token is sent as:

Authorization: Bearer <token>

A server MUST reject a connection without a valid token with not_authenticated. A server MUST NOT accept a token from a query string.

HTTP with Server-Sent Events

PathMethodPurpose
/v1/rpcPOSTOne request, one response. The body is a request envelope; the response body is a response envelope.
/v1/streamGETA long-lived SSE stream of pushes for the connection

The client sends requests on POST /v1/rpc and reads pushes from GET /v1/stream. Both carry the same bearer token. The stream rotates periodically, so clients MUST handle a reconnect by subscribing again from their cursor. The SSE stream does not use Last-Event-ID; the cursor in subscribe is the resume mechanism on every binding.

WebSocket

PathPurpose
/v1/wsA single WebSocket connection carrying requests, responses and pushes

Each WebSocket text frame carries exactly one message. A server MUST NOT split a message across frames or pack several into one.

gRPC

The service is robotelos.protocol.v1.Conversation. It has one bidirectional stream, and each message on the stream is one MCoP message encoded as raw JSON bytes. There is no IDL for the messages: the JSON schema in Schema is the contract. A server MUST close the stream when the connection ends.

Health

PathMeaning
GET /healthzThe process is alive. Always 200 while serving.
GET /readyzThe server can take traffic. 503 with the reason when it cannot.

These paths are not part of the protocol. They are for orchestrators.

Disconnects

A disconnect ends the connection’s subscriptions. It cancels no work: an agent turn that is running continues, and its events are recorded for every client that follows the conversation. A client that reconnects MUST initialize again and subscribe from its cursor.

Next steps