mcpStreamableHttp
Configures the Ktor Application to handle Model Context Protocol (MCP) over Streamable HTTP Transport
Sets up SSE, HTTP POST, and DELETE endpoints at the specified path. Simple request/response pairs are returned as JSON (not SSE streams).
Automatically installs ContentNegotiation with McpJson and SSE.
Parameters
The base path for the MCP Streamable HTTP endpoint. Defaults to "/mcp".
Enables DNS rebinding attack protection for the endpoint. Defaults to false.
A list of hostnames allowed to access the endpoint. If null, no restrictions are applied.
A list of origins allowed to perform cross-origin requests (CORS). If null, no restrictions are applied.
An optional EventStore instance to enable resumable event stream functionality. Allows storing and replaying events.
factory block with access to the RoutingContext (for reading request headers) that creates and returns the Server to handle the connection.