# `Snodo.Transport.StreamableHTTP`
[🔗](https://github.com/joshrotenberg/snodo/blob/v0.1.0/lib/snodo/transport/streamable_http.ex#L1)

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.

# `prepare_result`

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

# `execute`

```elixir
@spec execute(
  Snodo.Server.Runtime.t(),
  Snodo.Transport.StreamableHTTP.Prepared.t(),
  term() | nil
) ::
  Snodo.Transport.StreamableHTTP.Response.t()
  | Snodo.Transport.StreamableHTTP.StreamResponse.t()
```

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

# `handle`

```elixir
@spec handle(
  Snodo.Server.Runtime.t(),
  Snodo.Transport.StreamableHTTP.Request.t(),
  keyword()
) ::
  Snodo.Transport.StreamableHTTP.Response.t()
  | Snodo.Transport.StreamableHTTP.StreamResponse.t()
```

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

# `prepare`

```elixir
@spec prepare(
  Snodo.Server.Runtime.t(),
  Snodo.Transport.StreamableHTTP.Request.t(),
  keyword()
) ::
  prepare_result()
```

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
