StreamableHttpClientTransport
class StreamableHttpClientTransport(client: HttpClient, url: String, reconnectionOptions: ReconnectionOptions = ReconnectionOptions(), requestBuilder: HttpRequestBuilder.() -> Unit = {}) : AbstractClientTransport(source)
Client transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification. It will connect to a server using HTTP POST for sending messages and HTTP GET with Server-Sent Events for receiving messages.
Constructors
Link copied to clipboard
constructor(client: HttpClient, url: String, reconnectionOptions: ReconnectionOptions = ReconnectionOptions(), requestBuilder: HttpRequestBuilder.() -> Unit = {})
constructor(client: HttpClient, url: String, reconnectionTime: Duration?, requestBuilder: HttpRequestBuilder.() -> Unit = {})
Properties
Functions
Link copied to clipboard
Link copied to clipboard
suspend fun send(message: JSONRPCMessage, resumptionToken: String?, onResumptionToken: (String) -> Unit? = null)
Sends one or more messages with optional resumption support. This is the main send method that matches the TypeScript implementation.
Link copied to clipboard
Terminates the current session by sending a DELETE request to the server.