mcp
Registers MCP over Server-Sent Events (SSE) Transport at the specified path on this Route.
Precondition: the SSE plugin must be installed on the application before calling this function. Use Application.mcp if you want SSE to be installed automatically.
Parameters
the URL path to register the SSE endpoint.
whether to install DnsRebindingProtection on this route. Defaults to true.
hostnames allowed in the Host header. Defaults to localhost, 127.0.0.1, [::1].
origins allowed in the Origin header, compared by hostname only (scheme and port are ignored). Requests without an Origin header are allowed. Pass null to skip origin validation.
factory block with access to the ServerSSESession that creates and returns the Server to handle the connection.
Throws
if the SSE plugin is not installed.
Registers MCP over Server-Sent Events (SSE) Transport endpoints on this Route.
Precondition: the SSE plugin must be installed on the application before calling this function. Use Application.mcp if you want SSE to be installed automatically.
Parameters
whether to install DnsRebindingProtection on this route. Defaults to true.
hostnames allowed in the Host header. Defaults to localhost, 127.0.0.1, [::1].
origins allowed in the Origin header, compared by hostname only (scheme and port are ignored). Requests without an Origin header are allowed. Pass null to skip origin validation.
factory block with access to the ServerSSESession that creates and returns the Server to handle the connection.
Throws
if the SSE plugin is not installed.
Configures the Ktor Application to handle Model Context Protocol (MCP) over Server-Sent Events (SSE) Transport and sets up routing with the provided configuration block.
Automatically installs ContentNegotiation with McpJson and SSE.
Parameters
whether to install DnsRebindingProtection on this route. Defaults to true.
hostnames allowed in the Host header. Defaults to localhost, 127.0.0.1, [::1].
origins allowed in the Origin header, compared by hostname only (scheme and port are ignored). Requests without an Origin header are allowed. Pass null to skip origin validation.
factory block with access to the ServerSSESession that creates and returns the Server to handle the connection.