Smith::MCP::HttpTransport
Inherits Smith::MCP::Transport < Reference < Object
A Streamable-HTTP connection to a remote MCP server: JSON-RPC messages go out as POSTs, answers come back either as a JSON body or as an SSE stream — the spec requires the client to accept both, so both are read.
Fitted into the same Transport interface stdio uses: send enqueues a
message and the answers land on receive, matched by id in the client's
reader fiber. That keeps the restart-once logic, the approval gate and the
untrusted marking exactly where they already are.
Constants
Telling a server the session is over must never hold up shutdown — a server that is already gone cannot be told anyway.
Connecting to a host that routes into nowhere must not hang the session start for the full call timeout.
Constructors
Instance methods
Why the stream died, when the transport knows more than "EOF". stdio has nothing to add; an HTTP transport can say which status or which network error it was. Read once, when the pending callers are abandoned.
One complete message. Framing is line-based, so neither side may embed a raw newline — JSON escapes them, which is why this works at all.