File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
samples/kotlin-mcp-server/src/main/kotlin/io/modelcontextprotocol/sample/server Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import io.modelcontextprotocol.kotlin.sdk.types.ServerCapabilities
3131import io.modelcontextprotocol.kotlin.sdk.types.TextContent
3232import io.modelcontextprotocol.kotlin.sdk.types.TextResourceContents
3333import kotlinx.coroutines.Job
34+ import kotlinx.coroutines.awaitCancellation
3435import kotlinx.coroutines.runBlocking
3536import kotlinx.io.asSink
3637import kotlinx.io.asSource
@@ -121,6 +122,7 @@ fun runSseMcpServerWithPlainConfiguration(port: Int, wait: Boolean = true) {
121122 println (" Server session closed for: ${transport.sessionId} " )
122123 serverSessions.remove(transport.sessionId)
123124 }
125+ awaitCancellation()
124126 }
125127 post(" /message" ) {
126128 val sessionId: String? = call.request.queryParameters[" sessionId" ]
You can’t perform that action at this time.
0 commit comments