Expand description
Domain layer: value objects, aggregates and pure functions.
This layer has zero I/O dependencies. Time, randomness and session-id generation are injected from outside it rather than called globally, so every function here is deterministic and testable.
Populated by T04 (protocol version value objects), T05-T08 (feature profile, negotiation, canonical IR, per-revision codecs), T10 (the session aggregate: lifecycle, in-flight requests, cancellation, progress) and T11 (the registry’s pure half: primitives, visibility, snapshots).
Re-exports§
pub use bridge::Agreement;pub use bridge::Leg;pub use bridge::RefusedBy;pub use bridge::Withheld;pub use bridge::agree;pub use feature::DegradePolicy;pub use feature::FEATURES;pub use feature::Feature;pub use feature::FeatureProfile;pub use feature::FeatureSpec;pub use feature::Negotiation;pub use feature::resolve;pub use idempotency::Claim;pub use idempotency::ClaimToken;pub use idempotency::CompletedResults;pub use idempotency::IdempotencyError;pub use idempotency::IdempotencyKey;pub use idempotency::StaleClaim;pub use mcp::AuthorizationModel;pub use mcp::BearerMethod;pub use mcp::ClientRegistration;pub use mcp::MCP_METHOD_HEADER;pub use mcp::MCP_NAME_HEADER;pub use mcp::McpSessionId;pub use mcp::McpSessionIdError;pub use mcp::ResourceMetadata;pub use mcp::ResourceUri;pub use mcp::ResourceUriError;pub use mcp::RoutingHeaderError;pub use mcp::RoutingHeaders;pub use mcp::RoutingName;pub use mcp::RoutingTarget;pub use mcp::VISIBLE_ASCII_RANGE;pub use mcp::WELL_KNOWN;pub use mcp::client_method_defined_in;
Modules§
- a2a
- A2A domain — the version negotiation model, the per-revision
A2aFeatureProfile, and the value objects that the wire codecs (T28) lower into. - acp
domain::acp— the protocol-neutral ACP value objects.- bridge
- What a bridge can honestly promise.
- feature
Feature— the protocol behaviours a session may or may not have, andresolve— the pure function that decides which of them it has.- idempotency
- Running a peer-observable side effect at most once per key.
- ir
- The canonical, version-agnostic IR.
- jsonrpc
- The protocol-neutral JSON-RPC layer.
- mcp
- The parts of MCP that exist as wire headers rather than as IR.
- names
- The
eventname a legacy-transport frame carries, or the unnamed default. - oauth
- OAuth machinery that is not MCP-specific.
- registry
- The registry’s pure half: what a primitive is, who may see it, and the immutable set a publish hands to readers.
- session
- The session aggregate: lifecycle, in-flight requests, cancellation, progress.
- stateless_
meta_ keys - The capability names the stateless
_metais allowed to carry.
Structs§
- Capability
Set - A set of advertised capabilities.
- EventId
- A stream event’s position, as a client quotes it back.
- Event
Name - A validated
event:value. - Event
Ring - A bounded, replayable buffer of stream events.
- Frame
Decoder - Reassembles newline-delimited frames from arbitrarily chopped-up bytes.
- MaxFrame
Size - The largest frame a decoder will accept, in bytes, excluding the terminator.
- Message
Endpoint - The
endpointevent’s data, parsed once and used verbatim. - Negotiated
Session - A session that has agreed on a version and a feature profile.
- Peer
Info - What a peer calls itself.
- Rate
Limit - A request allowance:
limitrequests perwindow. - Recommended
Capacity - A capacity for a stream whose payload size the caller has not measured.
- Release
Date - A spec revision’s release date.
- Stateless
Request - What a stateless
2026-07-28request said about itself. - Stream
Event - One event, with the id a client would quote to resume after it.
- Supported
Versions - A non-empty, sorted, duplicate-free set of protocol versions.
- Transport
Spec - A transport named at an adapter boundary.
Enums§
- Capability
- A capability name as the specification spells it.
- Event
Name Error - Why a string is not usable as an
event:name. - Framing
Error - A frame that could not be framed.
- MaxFrame
Size Error - Why a
MaxFrameSizecould not be built. - Message
Endpoint Error - Why a string is not a usable message endpoint.
- Negotiation
Error - Why negotiation could not produce a session.
- Parse
Protocol Version Error - Why a string is not a
ProtocolVersion. - Parse
Release Date Error - Why a string is not a
YYYY-MM-DDrelease date. - Protocol
Version - A published MCP revision, or one published after this build was compiled.
- Replay
- What a client asking to resume actually gets.
- Request
Id - A JSON-RPC request id: a number or a string.
- Server
Decision - What the server decided to speak.
- Side
- Which side of the connection a capability is declared on.
- Spec
Error - Why a transport spec could not be read.
- Supported
Versions Error - Why a set of supported versions was rejected.
- Transport
Kind - A transport the specification defines.
- Unknown
Version Error - Why a date cannot become
ProtocolVersion::Unknown. - Verdict
- What
checkconcluded.
Constants§
- CAPABILITY_
TABLE - A capability and the revisions whose schemas define it.
- CLIENT_
CAPABILITY_ WIRE - How one client capability appears in a
ClientCapabilitiesobject. - RECOMMENDED_
CAPACITY - Events to retain for a stream whose payload size is unmeasured.
- SERVER_
CAPABILITY_ WIRE - How one server capability appears in a
ServerCapabilitiesobject.
Functions§
- assumed_
version - The version a request is assumed to be, given whatever signals it carries.
- assumed_
version_ without_ signal - The version a request is assumed to be when it carries no version signal at all.
- check_
protocol_ header - Checks an
MCP-Protocol-Versionheader against the negotiated version. - check_
rate_ limit - The outcome of one check.
- defined_
in - Whether
version’s schema definescapability. - discover_
defined_ in - Whether
server/discoverexists in this revision. - encode_
frame - Appends one frame — the document, then the terminator — to
out. - handshake_
defined_ in - Whether
versionhas aninitializehandshake at all. - is_
reserved_ meta_ key - Whether a
_metakey is one the stateless lifecycle reserves. - negotiate_
client - Client-side version negotiation.
- negotiate_
server - Server-side version negotiation.
- negotiate_
stateless - Stateless per-request negotiation, as
2026-07-28defines it. - transport_
allowed - Whether the specification defines
transportforversion.