Skip to content

Ktor extensions for StreamableHttpServerTransport #562

@kpavlov

Description

@kpavlov

Create Ktor extensions for StreamableHttpServerTransport.

Server should support both stateful and stateless operation mode.

1. Application-level extensions.

API might look like. Naming is an open question

application {
   routing {
     mcpStreamableHttp(config: StreamableHttpServerTransport.Configuration) { mcpServer }
   }
}

2. Route-level extensions. API might look like

application {
    install(SSE)
    routing {
        route("/mcp") {
            mcpStreamableHttp(config: StreamableHttpServerTransport.Configuration) { mcpServer }
        }
    }
}

Definition of Done:

For both (Application+Route level extensions) x (Statefull+stateless mode) = (4 combinations):

  1. Routes implemented
  2. Integration test for happy scenario
  3. Unit tests for route initialization, like this

Related PRs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues, valuable feature requestsapiPublic API changesenhancementNew feature or requestready for workHas enough information to start

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions