Client transport for the deprecated MCP 2024-11-05 HTTP+SSE protocol.
This is not Streamable HTTP. transport: :http, use_sse: true GETs the
same MCP endpoint after initialize. This transport instead:
- GETs
{base}/sse(or:sse_path) withAccept: text/event-stream - Reads the first
endpointevent (POST URI +sessionId) - POSTs JSON-RPC to that advertised URI
- Receives responses and server requests on the GET SSE stream
Options
:url- server origin or mount prefix, e.g."http://localhost:4000":sse_path- GET path (default"/sse"):post_path- optional override of the advertised POST path;sessionIdfrom theendpointevent is preserved:headers- extra HTTP headers:timeout/:request_timeout/:stream_handshake_timeout
Example
{:ok, client} =
ExMCP.Client.start_link(
transport: :sse,
url: "http://localhost:4000"
)
Summary
Types
@type t() :: %ExMCP.Transport.HTTP.LegacySSE{ allowed_private_hosts: [String.t()], base_url: String.t(), dns_resolver: module() | function(), dns_timeout_ms: pos_integer(), headers: [{String.t(), String.t()}], max_request_bytes: pos_integer(), max_response_bytes: pos_integer(), max_stream_buffer_bytes: pos_integer(), post_url: String.t(), session_id: String.t(), sse_pid: pid(), sse_url: String.t(), timeouts: map() }