AgentSea.MCP.Transport.Http (agentsea_mcp v0.1.0)

Copy Markdown

MCP "Streamable HTTP" transport. Each request is a JSON-RPC POST to the server endpoint; the response is parsed from either an application/json body or a text/event-stream (SSE) body.

A GenServer so it can carry the Mcp-Session-Id the server hands back on initialize and replay it on subsequent requests.

{:ok, transport} = AgentSea.MCP.Transport.Http.start_link(url: "https://host/mcp")
{:ok, client} = AgentSea.MCP.connect({AgentSea.MCP.Transport.Http, transport})

Summary

Functions

Returns a specification to start this module under a supervisor.

Start the transport. Options: :url (required), :headers, :adapter, :name.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

Start the transport. Options: :url (required), :headers, :adapter, :name.