File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
kotlin-mcp-server/src/main/kotlin/io/modelcontextprotocol/sample/server
weather-stdio-server/src/main/kotlin/io/modelcontextprotocol/sample/server Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ fun configureServer(): Server {
100100 return server
101101}
102102
103- suspend fun runSseMcpServerWithPlainConfiguration (port : Int ) {
103+ fun runSseMcpServerWithPlainConfiguration (port : Int ) {
104104 val serverSessions = ConcurrentMap <String , ServerSession >()
105105 println (" Starting SSE server on port $port " )
106106 println (" Use inspector to connect to http://localhost:$port /sse" )
@@ -136,7 +136,7 @@ suspend fun runSseMcpServerWithPlainConfiguration(port: Int) {
136136 transport.handlePostMessage(call)
137137 }
138138 }
139- }.startSuspend (wait = true )
139+ }.start (wait = true )
140140}
141141
142142/* *
@@ -147,15 +147,15 @@ suspend fun runSseMcpServerWithPlainConfiguration(port: Int) {
147147 *
148148 * @param port The port number on which the SSE MCP server will listen for client connections.
149149 */
150- suspend fun runSseMcpServerUsingKtorPlugin (port : Int ) {
150+ fun runSseMcpServerUsingKtorPlugin (port : Int ) {
151151 println (" Starting SSE server on port $port " )
152152 println (" Use inspector to connect to http://localhost:$port /sse" )
153153
154154 embeddedServer(CIO , host = " 127.0.0.1" , port = port) {
155155 mcp {
156156 return @mcp configureServer()
157157 }
158- }.startSuspend (wait = true )
158+ }.start (wait = true )
159159}
160160
161161/* *
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import io.ktor.http.ContentType
77import io.ktor.http.contentType
88import io.ktor.http.headers
99import io.ktor.serialization.kotlinx.json.json
10- import io.ktor.utils.io.core.Input
1110import io.ktor.utils.io.streams.asInput
1211import io.modelcontextprotocol.kotlin.sdk.CallToolResult
1312import io.modelcontextprotocol.kotlin.sdk.Implementation
@@ -19,7 +18,6 @@ import io.modelcontextprotocol.kotlin.sdk.server.ServerOptions
1918import io.modelcontextprotocol.kotlin.sdk.server.StdioServerTransport
2019import kotlinx.coroutines.Job
2120import kotlinx.coroutines.runBlocking
22- import kotlinx.io.Sink
2321import kotlinx.io.asSink
2422import kotlinx.io.buffered
2523import kotlinx.serialization.json.Json
You can’t perform that action at this time.
0 commit comments