mcpStatelessStreamableHttp
Configures the Ktor Application to handle Model Context Protocol (MCP) over stateless Streamable HTTP Transport
Sets up an HTTP POST endpoint at path. GET and DELETE requests return 405 Method Not Allowed. Simple request/response pairs are returned as JSON (not SSE streams).
Automatically installs ContentNegotiation with McpJson and SSE.
Parameters
The URL path where the server listens for incoming JSON-RPC requests. Defaults to "/mcp".
Determines whether DNS rebinding protection is enabled. Defaults to false.
A list of allowed hostnames. If null, host filtering is disabled.
A list of allowed origins for CORS. If null, origin filtering is disabled.
An optional EventStore implementation to provide resumability and event replay support.
factory block with access to the RoutingContext (for reading request headers) that creates and returns the Server to handle the connection.