barrel_mcp_client_transport behaviour (barrel_mcp v2.0.2)
View SourceTransport behaviour for barrel_mcp_client.
A transport owns the underlying socket/port/process and forwards inbound JSON-RPC messages to the owning client gen_statem. The client never reads the wire directly; it only sends/closes through this behaviour and consumes asynchronous messages of the form:
{mcp_in, TransportPid, JsonBinary}— one decoded JSON-RPC envelope arrived from the peer.{mcp_closed, TransportPid, Reason}— the transport ended (peer hung up, port exited, etc.).
Transports MUST deliver one envelope per mcp_in message; framing (line splitting, SSE parsing) is the transport's responsibility.
Summary
Functions
Convenience wrapper to close any transport handle.
Convenience wrapper to send through any transport handle.