mcp Streamable Http
suspend fun HttpClient.mcpStreamableHttp(url: String, reconnectionOptions: ReconnectionOptions = ReconnectionOptions(), requestBuilder: HttpRequestBuilder.() -> Unit = {}): Client(source)
Creates and connects an MCP client over Streamable HTTP using the provided HttpClient.
Return
A connected Client ready for MCP communication.
Parameters
url
URL of the MCP server.
reconnection Options
Options for controlling SSE reconnection behavior.
request Builder
Optional lambda to configure the HTTP request.
suspend fun HttpClient.mcpStreamableHttp(url: String, reconnectionTime: Duration?, requestBuilder: HttpRequestBuilder.() -> Unit = {}): Client(source)
Deprecated
Use overload with ReconnectionOptions
Replace with
mcpStreamableHttp(url, ReconnectionOptions(initialReconnectionDelay = reconnectionTime ?: 1.seconds), requestBuilder)Content copied to clipboard
Creates and connects an MCP client over Streamable HTTP using the provided HttpClient.
Return
A connected Client ready for MCP communication.
Parameters
url
URL of the MCP server.
reconnection Time
Optional duration to wait before attempting to reconnect.
request Builder
Optional lambda to configure the HTTP request.