mcpWebSocketTransport

fun HttpClient.mcpWebSocketTransport(urlString: String? = null, requestBuilder: HttpRequestBuilder.() -> Unit = {}): WebSocketClientTransport(source)

Returns a new WebSocket transport for the Model Context Protocol using the provided HttpClient.

Return

A WebSocketClientTransport configured for MCP communication.

Parameters

urlString

Optional URL of the MCP server.

requestBuilder

Optional lambda to configure the HTTP request.