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
8
8
import io.ktor.server.routing.Routing
9
9
import io.ktor.server.routing.RoutingContext
10
10
import io.ktor.server.routing.post
11
+ import io.ktor.server.routing.route
11
12
import io.ktor.server.routing.routing
12
13
import io.ktor.server.sse.SSE
13
14
import io.ktor.server.sse.ServerSSESession
@@ -60,7 +61,7 @@ public fun Routing.mcp(block: ServerSSESession.() -> Server) {
60
61
61
62
@Suppress(" FunctionName" )
62
63
@Deprecated(" Use mcp() instead" , ReplaceWith (" mcp(block)" ), DeprecationLevel .ERROR )
63
- public fun Application.MCP (block : () -> Server ) {
64
+ public fun Application.MCP (block : ServerSSESession . () -> Server ) {
64
65
mcp(block)
65
66
}
66
67
Original file line number Diff line number Diff line change @@ -152,8 +152,8 @@ public open class Server(
152
152
* Registers a callback to be invoked when the server has completed initialization.
153
153
*/
154
154
@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 " ),
157
157
DeprecationLevel .WARNING
158
158
)
159
159
public fun onInitialized (block : () -> Unit ) {
Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ import kotlinx.coroutines.withTimeout
28
28
import kotlin.test.Test
29
29
import kotlin.test.assertTrue
30
30
import io.ktor.client.engine.cio.CIO as ClientCIO
31
- import io.ktor.client.plugins.sse.SSE as ClientSSE
32
31
import io.ktor.server.cio.CIO as ServerCIO
33
32
import io.ktor.server.sse.SSE as ServerSSE
34
33
35
34
private const val URL = " 127.0.0.1"
35
+ private const val PORT = 0
36
36
37
37
class SseIntegrationTest {
38
38
@Test
@@ -171,7 +171,7 @@ class SseIntegrationTest {
171
171
)
172
172
}
173
173
174
- val ktorServer = embeddedServer(ServerCIO , host = URL , port = 0 ) {
174
+ val ktorServer = embeddedServer(ServerCIO , host = URL , port = PORT ) {
175
175
install(ServerSSE )
176
176
routing {
177
177
mcp { server }
You can’t perform that action at this time.
0 commit comments