kotlin-sdk/kotlin-sdk-client
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Konstantin Pavlov e584cfe882
fix(sse-client): Skip SSE in StreamableHttpClientTransport when data is empty (#433)
Refactor StreamableHttpClientTransport to skip SSE when the data field
is empty.


## Motivation and Context

TypeScript SSE Server started returning Server-Sent Events with only id
and empty data field (Heartbeat/Checkpoint), followed by an event with
data, e.g.:
```
id: d85c6bb0-0fa2-4828-81ad-3e951131aea5_1764226144689_7qb3iojc
data: 

event: message
id: d85c6bb0-0fa2-4828-81ad-3e951131aea5_1764226144690_sodh20lo
data: {"result":{"protocolVersion":"2025-06-18","capabilities":{"logging":{},"tools":{"listChanged":true},"prompts":{"listChanged":true},"completions":{},"resources":{"listChanged":true}},"serverInfo":{"name":"simple-streamable-http-server","version":"1.0.0"}},"jsonrpc":"2.0","id":"7ce065b0678f49e5b04ce5a0fcc7d518"}

```

Such empty events might be used by the server as **Heartbeat** or
**Checkpoint** events. The client should retain the updated
Last-Event-ID and disregard the payload. It is essential to handle such
responses to ensure compatibility with updated TypeScript SDK.

## How Has This Been Tested?

- Added integration test
- Regression tests are green now

## Breaking Changes
No

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [ ] I have added appropriate error handling
- [ ] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
2025-11-27 18:12:14 +02:00
..
api Add options in Transport.send method (#408) 2025-11-20 20:17:15 +01:00
src fix(sse-client): Skip SSE in StreamableHttpClientTransport when data is empty (#433) 2025-11-27 18:12:14 +02:00
build.gradle.kts Kotlin-MCP can't be used without ktor-bom starting from 0.7.5 (#390) (#392) 2025-11-12 15:32:54 +02:00
Module.md Add module documentation and enhance Dokka configuration (#261) 2025-09-15 17:44:43 +02:00