Skip to content

Commit 68faa51

Browse files
devcrocode5l
andauthored
Remove CompletableDeferred (#57)
Co-authored-by: Leonid Stashevsky <e5l@users.noreply.github.com>
1 parent 1fbf819 commit 68faa51

File tree

1 file changed

+1
-4
lines changed
  • samples/weather-stdio-server/src/main/kotlin/io/modelcontextprotocol/sample/server

1 file changed

+1
-4
lines changed

samples/weather-stdio-server/src/main/kotlin/io/modelcontextprotocol/sample/server/McpWeatherServer.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import io.modelcontextprotocol.kotlin.sdk.*
1010
import io.modelcontextprotocol.kotlin.sdk.server.Server
1111
import io.modelcontextprotocol.kotlin.sdk.server.ServerOptions
1212
import io.modelcontextprotocol.kotlin.sdk.server.StdioServerTransport
13-
import kotlinx.coroutines.CompletableDeferred
1413
import kotlinx.coroutines.Job
1514
import kotlinx.coroutines.runBlocking
1615
import kotlinx.io.asSink
@@ -19,8 +18,6 @@ import kotlinx.serialization.json.*
1918

2019
// Main function to run the MCP server
2120
fun `run mcp server`() {
22-
val def = CompletableDeferred<Unit>()
23-
2421
// Base URL for the Weather API
2522
val baseUrl = "https://api.weather.gov"
2623

@@ -52,7 +49,7 @@ fun `run mcp server`() {
5249
ServerOptions(
5350
capabilities = ServerCapabilities(tools = ServerCapabilities.Tools(listChanged = true))
5451
)
55-
) { def.complete(Unit) }
52+
)
5653

5754
// Register a tool to fetch weather alerts by state
5855
server.addTool(

0 commit comments

Comments
 (0)