File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
kotlin-sdk-server/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server
kotlin-sdk-test/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/integration Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import io.ktor.server.response.respond
88import io.ktor.server.routing.Routing
99import io.ktor.server.routing.RoutingContext
1010import io.ktor.server.routing.post
11+ import io.ktor.server.routing.route
1112import io.ktor.server.routing.routing
1213import io.ktor.server.sse.SSE
1314import io.ktor.server.sse.ServerSSESession
@@ -60,7 +61,7 @@ public fun Routing.mcp(block: ServerSSESession.() -> Server) {
6061
6162@Suppress(" FunctionName" )
6263@Deprecated(" Use mcp() instead" , ReplaceWith (" mcp(block)" ), DeprecationLevel .ERROR )
63- public fun Application.MCP (block : () -> Server ) {
64+ public fun Application.MCP (block : ServerSSESession . () -> Server ) {
6465 mcp(block)
6566}
6667
Original file line number Diff line number Diff line change @@ -152,8 +152,8 @@ public open class Server(
152152 * Registers a callback to be invoked when the server has completed initialization.
153153 */
154154 @Deprecated(
155- " Will be removed with Protocol inheritance. Use onConnect instead." ,
156- ReplaceWith (" onConnect " ),
155+ " Initialization moved to ServerSession, use ServerSession.onInitialized instead." ,
156+ ReplaceWith (" ServerSession.onInitialized " ),
157157 DeprecationLevel .WARNING
158158 )
159159 public fun onInitialized (block : () -> Unit ) {
Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ import kotlinx.coroutines.withTimeout
2828import kotlin.test.Test
2929import kotlin.test.assertTrue
3030import io.ktor.client.engine.cio.CIO as ClientCIO
31- import io.ktor.client.plugins.sse.SSE as ClientSSE
3231import io.ktor.server.cio.CIO as ServerCIO
3332import io.ktor.server.sse.SSE as ServerSSE
3433
3534private const val URL = " 127.0.0.1"
35+ private const val PORT = 0
3636
3737class SseIntegrationTest {
3838 @Test
@@ -171,7 +171,7 @@ class SseIntegrationTest {
171171 )
172172 }
173173
174- val ktorServer = embeddedServer(ServerCIO , host = URL , port = 0 ) {
174+ val ktorServer = embeddedServer(ServerCIO , host = URL , port = PORT ) {
175175 install(ServerSSE )
176176 routing {
177177 mcp { server }
You can’t perform that action at this time.
0 commit comments