Appearance
Protocol Adapters
Matrix's transport is NATS. Every actor invocation, event, and state record flows over NATS subjects. Other protocols are adapters that translate from their wire shape into NATS publishes/subscribes and back. The actor doesn't know or care which adapter brought the call in.
| Page | Status today |
|---|---|
| NATS | Native. Production. The reference implementation. |
| HTTP gateway | Production. system.gateway.http serves webapp routes and exposes gateway.http.request ops. |
| WebSocket | Production. Browsers connect to NATS via /nats-ws. |
| MCP | Partial. Actors expose declarations through $introspect; an MCP server adapter is workstream material. |
| REST/OpenAPI bridge | Target. The contract is defined; the bridge actor is partially implemented. |
| gRPC bridge | Target. Documented in ACTOR-COMMUNICATION-CONTRACT.md; not implemented. |
| AsyncAPI bridge | Target. Documented; not implemented. |
Why this layer exists
The static accepts | emits | streams | state declarations on every actor are protocol-neutral. An adapter walks the declarations and generates a protocol-specific surface:
| Declaration | OpenAPI | gRPC | MCP | AsyncAPI |
|---|---|---|---|---|
accepts | POST endpoints | Unary RPCs | Tools | Request channels |
emits | SSE endpoints | Server streaming | — | Pub channels |
streams | — | Server streaming | — | Pub channels (durable) |
state | GET endpoints | Unary RPCs | Resources | — |
subscribes | — | — | — | Sub channels |
blackboard | GET/PUT endpoints | Bidirectional streaming | Resources | Pub/Sub channels |
Source:
WORKSTREAMS/core-and-packaging/ACTOR-COMMUNICATION-CONTRACT.md§ "How they map to protocol gateways".
Read order
If you are implementing an adapter, read in this order:
- NATS — the canonical wire model.
- HTTP gateway — the production-grade adapter to study.
- WebSocket — the same-origin browser path.
- MCP — the LLM-native discovery surface.
- The three target adapters (REST/OpenAPI, gRPC, AsyncAPI) — design targets not yet shipping.
See also
- Subjects — wire form the adapters translate.
- Request envelope — the invariant shape across adapters.
ACTOR-COMMUNICATION-CONTRACT.md— declarations driving each adapter.