StreamableHttpClientTransport
constructor(client: HttpClient, url: String, reconnectionOptions: ReconnectionOptions = ReconnectionOptions(), requestBuilder: HttpRequestBuilder.() -> Unit = {})(source)
Parameters
client
Ktor HTTP client used for all requests
url
MCP endpoint URL
reconnectionOptions
reconnection backoff and retry-limit settings for the SSE stream
requestBuilder
builder applied to every outgoing HTTP request, e.g. for adding auth headers
constructor(client: HttpClient, url: String, reconnectionTime: Duration?, requestBuilder: HttpRequestBuilder.() -> Unit = {})(source)
Deprecated
Use constructor with ReconnectionOptions
Replace with
import kotlin.time.Duration.Companion.seconds
import io.modelcontextprotocol.kotlin.sdk.client.ReconnectionOptions
Content copied to clipboard
StreamableHttpClientTransport(client, url, ReconnectionOptions(initialReconnectionDelay = reconnectionTime ?: 1.seconds), requestBuilder)Content copied to clipboard