Codex.MCP.Transport.StreamableHTTP (Codex SDK v0.7.2)

Copy Markdown View Source

Implements MCP JSON-RPC over HTTP with optional bearer or OAuth auth.

Summary

Functions

Returns a specification to start this module under a supervisor.

Receives the next JSON-RPC message from the MCP server.

Sends a JSON-RPC message to the MCP server.

Starts a streamable HTTP transport process.

Types

t()

@type t() :: pid()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

recv(pid, timeout_ms)

@spec recv(t(), pos_integer()) :: {:ok, map()} | {:error, term()}

Receives the next JSON-RPC message from the MCP server.

send(pid, message)

@spec send(t(), map()) :: :ok | {:error, term()}

Sends a JSON-RPC message to the MCP server.

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Starts a streamable HTTP transport process.