modelcontextprotocol / modelcontextprotocol/kotlin-sdk

Ktor extensions for StreamableHttpServerTransport

Open
#562 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api enhancement P2 ready for work
Dominant language
Kotlin
Stars
1.5k
Forks
248
Avg merge
1d 20h
Merged PRs (30d)
23

Description

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:

  • #504 initial implementation
  • #560 streamable transport configuration
  • #563
  • #535

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the initial implementation in #504 and the transport configuration in #560, then compare the referenced KtorStatelessStreamableHttpRouteExtensionsTest. Define the application- and route-level extensions for both stateful and stateless modes, with routes, happy-path integration tests, and route-initialization unit tests covering all four combinations.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.