StreamableHttpClientTransport
class StreamableHttpClientTransport(client: HttpClient, url: String, reconnectionTime: Duration? = null, requestBuilder: HttpRequestBuilder.() -> Unit = {}) : AbstractTransport(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, reconnectionTime: Duration? = null, requestBuilder: HttpRequestBuilder.() -> Unit = {})
Functions
Link copied to clipboard
Link copied to clipboard
Sends a single message with optional resumption support
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.