@@ -19,7 +19,7 @@ import io.ktor.utils.io.KtorDsl
1919private val logger = KotlinLogging .logger {}
2020
2121@KtorDsl
22- public fun Routing.mcp (path : String , block : () -> Server ) {
22+ public fun Routing.mcp (path : String , block : ServerSSESession . () -> Server ) {
2323 route(path) {
2424 mcp(block)
2525 }
@@ -29,7 +29,7 @@ public fun Routing.mcp(path: String, block: () -> Server) {
2929 * Configures the Ktor Application to handle Model Context Protocol (MCP) over Server-Sent Events (SSE).
3030 */
3131@KtorDsl
32- public fun Routing.mcp (block : () -> Server ) {
32+ public fun Routing.mcp (block : ServerSSESession . () -> Server ) {
3333 val transports = ConcurrentMap <String , SseServerTransport >()
3434
3535 sse {
@@ -43,12 +43,12 @@ public fun Routing.mcp(block: () -> Server) {
4343
4444@Suppress(" FunctionName" )
4545@Deprecated(" Use mcp() instead" , ReplaceWith (" mcp(block)" ), DeprecationLevel .WARNING )
46- public fun Application.MCP (block : () -> Server ) {
46+ public fun Application.MCP (block : ServerSSESession . () -> Server ) {
4747 mcp(block)
4848}
4949
5050@KtorDsl
51- public fun Application.mcp (block : () -> Server ) {
51+ public fun Application.mcp (block : ServerSSESession . () -> Server ) {
5252 val transports = ConcurrentMap <String , SseServerTransport >()
5353
5454 install(SSE )
@@ -67,7 +67,7 @@ public fun Application.mcp(block: () -> Server) {
6767private suspend fun ServerSSESession.mcpSseEndpoint (
6868 postEndpoint : String ,
6969 transports : ConcurrentMap <String , SseServerTransport >,
70- block : () -> Server ,
70+ block : ServerSSESession . () -> Server ,
7171) {
7272 val transport = mcpSseTransport(postEndpoint, transports)
7373
0 commit comments