Skip to content

Brothers, when will the Kotlin SDK support Streamable HTTP? #346

Closed

Description

@bczhaoa

Brothers, when will the Kotlin SDK support Streamable HTTP?

Activity

  1. Moyuyanli commented on Oct 28, 2025

    @Moyuyanli

    不是支持吗?

  2. bczhaoa commented on Oct 28, 2025

    @bczhaoa
    Author

    no. no support

  3. Moyuyanli commented on Oct 28, 2025

    @Moyuyanli

    I implemented it after modifying some StreamableHttpClientTransport code.

  4. bczhaoa commented on Oct 28, 2025

    @bczhaoa
    Author

    Could you post your code for reference?

  5. Moyuyanli commented on Oct 28, 2025

    @Moyuyanli

    My solution isn't particularly elegant; it just gets the job done.

    Replace the following code in the send method:

    // if (response.status == HttpStatusCode.Accepted) {
    // if (message is JSONRPCNotification && message.method == "notifications/initialized") {
    // startSseSession(onResumptionToken = onResumptionToken)
    // }
    // return
    // }

    With:

    when (response.contentType()?.withoutParameters()) {
    ContentType.Application.Json -> {
    val body = response.bodyAsText()
    if (body.isNotBlank()) {
    runCatching { McpJson.decodeFromString<JSONRPCMessage>(body) }
    .onSuccess { _onMessage(it) }
    .onFailure { _onError(it); throw it }
    }
    }
    
    ContentType.Text.EventStream -> {
    // Handle all streaming responses here
    handleInlineSse(
    response,
    replayMessageId = if (message is JSONRPCRequest) message.id else null,
    onResumptionToken = onResumptionToken
    )
    }
    
    else -> {
    if (response.status.isSuccess()) {
    return // Normal no-content response
    }
    val error =
    StreamableHttpError(response.status.value, "Unexpected content type: ${response.contentType()}")
    _onError(error)
    throw error
    }
    }

    Then, simply modify the handleInlineSse() method to make it compatible with handling other types of responses.

  6. devcrocod commented on Oct 28, 2025

    @devcrocod
    Contributor

    Streamable http for the client was introduced in version 0.6.0.

    We’re currently working on adding streamable HTTP support for the server. There’s an open pr #235 by @zshea, and I’ve also been implementing a streamable HTTP server in my branch

  7. bczhaoa commented on Oct 28, 2025

    @bczhaoa
    Author

    Thank you very much, looking forward to an early release of a version with support.

  8. bczhaoa commented on Dec 26, 2025

    @bczhaoa
    Author

    It's been two months now, and there's been no progress at all. Is this issue being addressed? When is it planned to be resolved? Could you please provide a clear answer? I'm thinking of switching to the Java SDK. @devcrocod @kpavlov

  9. karthyks commented on Dec 29, 2025

    @karthyks

    Java SDK - Tightly coupled with Spring framework
    Quarkus SDK - Not many contributions, but at least supports Streamable HTTP for server.
    Kotlin SDK - Far behind in features.

    Maybe JVM is just not right for AI tooling. I hope I am wrong in 2026.

  10. devcrocod commented on Apr 8, 2026

    @devcrocod
    Contributor

    Streamable HTTP is implemented for both client and server as of 0.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions