@@ -19,7 +19,7 @@ import io.ktor.utils.io.KtorDsl
19
19
private val logger = KotlinLogging .logger {}
20
20
21
21
@KtorDsl
22
- public fun Routing.mcp (path : String , block : () -> Server ) {
22
+ public fun Routing.mcp (path : String , block : ServerSSESession . () -> Server ) {
23
23
route(path) {
24
24
mcp(block)
25
25
}
@@ -29,7 +29,7 @@ public fun Routing.mcp(path: String, block: () -> Server) {
29
29
* Configures the Ktor Application to handle Model Context Protocol (MCP) over Server-Sent Events (SSE).
30
30
*/
31
31
@KtorDsl
32
- public fun Routing.mcp (block : () -> Server ) {
32
+ public fun Routing.mcp (block : ServerSSESession . () -> Server ) {
33
33
val transports = ConcurrentMap <String , SseServerTransport >()
34
34
35
35
sse {
@@ -43,12 +43,12 @@ public fun Routing.mcp(block: () -> Server) {
43
43
44
44
@Suppress(" FunctionName" )
45
45
@Deprecated(" Use mcp() instead" , ReplaceWith (" mcp(block)" ), DeprecationLevel .WARNING )
46
- public fun Application.MCP (block : () -> Server ) {
46
+ public fun Application.MCP (block : ServerSSESession . () -> Server ) {
47
47
mcp(block)
48
48
}
49
49
50
50
@KtorDsl
51
- public fun Application.mcp (block : () -> Server ) {
51
+ public fun Application.mcp (block : ServerSSESession . () -> Server ) {
52
52
val transports = ConcurrentMap <String , SseServerTransport >()
53
53
54
54
install(SSE )
@@ -67,7 +67,7 @@ public fun Application.mcp(block: () -> Server) {
67
67
private suspend fun ServerSSESession.mcpSseEndpoint (
68
68
postEndpoint : String ,
69
69
transports : ConcurrentMap <String , SseServerTransport >,
70
- block : () -> Server ,
70
+ block : ServerSSESession . () -> Server ,
71
71
) {
72
72
val transport = mcpSseTransport(postEndpoint, transports)
73
73
0 commit comments