Roles and ownership

The roles in MCoP: clients, the server, the agent, the store and the principal, and what each one owns.

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

StateOwner
Conversations, participants, events, receiptsThe server, through the store
Who may do what in a conversationThe server, from participant roles
Approval decisionsThe server, from the responder’s answer
The agent’s reasoning and tool useThe agent, which proposes only
The client’s view of a conversationThe client, reduced from events it has received
The transport sessionThe 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 calls server.New with the in-memory store.
  • Replicated: several servers share one PostgreSQL store. They wake each other with LISTEN and NOTIFY, and claim agent turns under a lease. This is the gateway in runtime/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