Roles and ownership
This page covers the roles inside the protocol. For the whole platform (control plane, fleets, execution hosts), read Architecture.
Roles
Client. Any program that speaks MCoP: a Go application, a terminal, a browser or an adapter for another chat system. A client holds one or more connections, and each connection follows zero or more conversations. A client acts for a principal.
Server. The process that accepts connections, authenticates principals, validates commands, appends events to the journal and delivers frames. In this repository the server is protocol/server and runs as the gateway on PostgreSQL or in memory.
Agent. The component that produces replies and approval requests for a conversation. It sits behind the agent port, which has two methods, Reply and Resume. An agent proposes; it does not decide. Its output becomes events only when the server accepts it.
Store. The place where the journal, receipts and pending agent turns are kept. Every change to one conversation is one transaction in the store. The store is a seam: the in-memory store and the PostgreSQL store pass the same conformance suite.
Principal. The identity a connection authenticates as: an ID, an account and a display name. The principal’s ID becomes the sender of its commands and events.
Ownership
| State | Owner |
|---|---|
| Conversations, participants, events, receipts | The server, through the store |
| Who may do what in a conversation | The server, from participant roles |
| Approval decisions | The server, from the responder’s answer |
| The agent’s reasoning and tool use | The agent, which proposes only |
| The client’s view of a conversation | The client, reduced from events it has received |
| The transport session | The transport and the client |
A server MUST NOT trust a client’s view. Every check happens against the journal.
Deployment shapes
- Embedded: the server runs in the same process as the client, over the in-memory transport. This is how tests run.
- Single process: one server, one store. This is the embedded server of
apps/console, or any program that callsserver.Newwith the in-memory store. - Replicated: several servers share one PostgreSQL store. They wake each other with
LISTENandNOTIFY, and claim agent turns under a lease. This is the gateway inruntime/cmd/gateway.
The protocol does not change between these shapes. A client written for one works with the others.
Boundaries
MCoP covers how clients and servers talk and what the journal records. It does not define:
- how an agent reasons or which models it uses;
- how an agent executes tools internally.
These belong to other layers. The protocol only carries their results as events.
Next steps
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.