Skip to content

kotlin-sdk-server 0.10.0 crashes with NoSuchMethodError when used with Ktor 3.4.x #666

@MaXal

Description

@MaXal

Describe the bug
NoSuchMethodError at runtime when using kotlin-sdk-server:0.10.0 with Ktor 3.4.x. The SDK's mcp() extension calls sse(Route, Function2) which no longer exists in ktor-server-sse:3.4.x (SSE routing API signature changed). The SDK declares ktor-server-sse:3.2.3, but Gradle resolves to the consumer's higher 3.4.x version, causing binary incompatibility.

To Reproduce
Steps to reproduce the behavior:

  1. Add io.modelcontextprotocol:kotlin-sdk-server:0.10.0 and io.ktor:ktor-server-sse:3.4.2 to dependencies
  2. Call mcp { ... } inside a Ktor embeddedServer block
  3. Start the server

Expected behavior
The MCP server starts without errors, or the SDK documents the supported Ktor version range.

Logs

Exception in thread "main" java.lang.NoSuchMethodError: 'void io.ktor.server.sse.RoutingKt.sse(io.ktor.server.routing.Route, kotlin.jvm.functions.Function2)'
      at io.modelcontextprotocol.kotlin.sdk.server.KtorServerKt.mcp(KtorServer.kt:75)

Additional context
Works fine on Ktor 3.3.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions