Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
kotlin = "2.3.0"

# MCP SDK
mcp-sdk = "0.8.1"
mcp-sdk = "0.9.0"
kotlinx-io = "0.8.2"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import io.ktor.server.routing.routing
import io.ktor.server.sse.SSE
import io.ktor.server.sse.sse
import io.ktor.util.collections.ConcurrentMap
import io.modelcontextprotocol.kotlin.sdk.server.ClientConnection
import io.modelcontextprotocol.kotlin.sdk.server.Server
import io.modelcontextprotocol.kotlin.sdk.server.ServerOptions
import io.modelcontextprotocol.kotlin.sdk.server.ServerSession
Expand Down Expand Up @@ -116,8 +117,8 @@ class McpServer(
/**
* Creates a handler for the get_server_status tool that returns current execution status and messages.
*/
private fun createStatusHandler(): (CallToolRequest) -> CallToolResult =
{ _ ->
private fun createStatusHandler(): suspend (ClientConnection, CallToolRequest) -> CallToolResult =
{ _, _ ->
val isRunning = executionSemaphore.availablePermits() == 0
val status =
when {
Expand Down Expand Up @@ -170,8 +171,8 @@ class McpServer(
* Creates a tool handler for background execution with proper error handling and status
* tracking.
*/
private fun createToolHandler(): (CallToolRequest) -> CallToolResult =
{ request ->
private fun createToolHandler(): suspend (ClientConnection, CallToolRequest) -> CallToolResult =
{ _, request ->
// Try to acquire semaphore without blocking
if (!executionSemaphore.tryAcquire()) {
// Another command is already running
Expand Down
Loading