Snodo.Transport.StreamableHTTP (snodo v0.1.0)

Copy Markdown View Source

Protocol-driven adapter for stateless Streamable HTTP requests.

The default dialect is 2026-07-28. Explicitly enabled initialize-era dialects share admission and execution without creating HTTP sessions.

prepare/3 performs HTTP and mirrored-header admission without invoking an application handler. execute/3 runs one prepared message through the shared synchronous server core. This split lets HTTP servers admit a request before submitting only application work to Snodo.Server.Executor.

Complete JSON responses and long-lived SSE descriptors are deliberately transport-server agnostic so Plug, Bandit, Cowboy, or a custom listener can translate them without changing protocol code.

Summary

Functions

Executes one admitted request; transports may supply a cancellation token.

Runs admission and execution synchronously for embedding in another HTTP stack.

Admits and decodes one HTTP request without executing its MCP handler.

Types

prepare_result()

@type prepare_result() ::
  {:ok, Snodo.Transport.StreamableHTTP.Prepared.t()}
  | {:response, Snodo.Transport.StreamableHTTP.Response.t()}

Functions

execute(runtime, prepared, cancellation \\ nil)

Executes one admitted request; transports may supply a cancellation token.

handle(runtime, request, opts \\ [])

Runs admission and execution synchronously for embedding in another HTTP stack.

prepare(runtime, request, opts \\ [])

Admits and decodes one HTTP request without executing its MCP handler.