Mead.MCP.Transport.Http (mead v0.1.1)

Copy Markdown View Source

The Streamable HTTP transport of MCP: every message is a POST, and the answer is either one JSON body or an event stream that ends with the answer.

Options

  • :url - http:// or https:// endpoint (required).
  • :headers - a list of {name, value} binaries sent on every request, for credentials.
  • :receive_timeout - milliseconds to wait for an answer; defaults to 30 000.
  • :req_options - extra options merged into every Req request, used by tests to stub the network.

Each POST runs in its own task, so a slow answer never blocks another request. The whole response is read before it is decoded, which is why no incremental delivery is needed from Req. The server may assign a session id in the mcp-session-id header; it is echoed on every later request, and a 404 after a session was assigned means the session expired, which closes the transport so the connection starts over.

Not verified against a real remote server: only against a Plug double. Reasons never contain the configured headers.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.