mcpWebSocket

fun Route.mcpWebSocket(options: ServerOptions? = null, handler: suspend Server.() -> Unit = {})(source)

Registers a WebSocket route that establishes an MCP (Model Context Protocol) server session.

Parameters

options

Optional server configuration settings for the MCP server.

handler

A suspend function that defines the server's behavior.


fun Route.mcpWebSocket(path: String, options: ServerOptions? = null, handler: suspend Server.() -> Unit = {})(source)

Registers a WebSocket route at the specified path that establishes an MCP server session.

Parameters

path

The URL path at which to register the WebSocket route.

options

Optional server configuration settings for the MCP server.

handler

A suspend function that defines the server's behavior.