Skip to content

feat: implement Streamable HTTP transport and refactor SSE transport to reactive streams #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

tzolov
Copy link
Contributor

@tzolov tzolov commented Jun 24, 2025

This change improves the transport layer with reactive patterns and adds support for the latest MCP specification while maintaining backward compatibility with existing SSE transport.

  • Add HttpClientStreamableHttpTransport implementing 2025-03-26 MCP Streamable HTTP spec
  • Add ResponseSubscribers utility for handling SSE and JSON HTTP responses
  • Refactor HttpClientSseClientTransport to use reactive streams instead of CompletableFuture
    • Replace FlowSseClient with direct reactive stream handling
    • Use Disposable-based connection management instead of CountDownLatch
    • Replace message endpoint discovery with Sinks.One approach
  • Add resiliency tests using Toxiproxy for network failure scenarios
  • Minor type safety improvements in StdioClientTransport and DefaultMcpTransportStream

tzolov added 5 commits June 24, 2025 13:03
…to reactive streams

This change imporves the transport layer with reactive patterns and adds support for
the latest MCP specification while maintaining backward compatibility with existing SSE transport.

- Add HttpClientStreamableHttpTransport implementing 2025-03-26 MCP Streamable HTTP spec
- Add ResponseSubscribers utility for handling SSE and JSON HTTP responses
- Refactor HttpClientSseClientTransport to use reactive streams instead of CompletableFuture
  - Replace FlowSseClient with direct reactive stream handling
  - Use Disposable-based connection management instead of CountDownLatch
  - Replace message endpoint discovery with Sinks.One approach
- Add resiliency tests using Toxiproxy for network failure scenarios
- Minor type safety improvements in StdioClientTransport and DefaultMcpTransportStream

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Add proper exception handling with CompletableFuture.exceptionallyCompose for async HTTP operations
- Add test for specific exception type handling in resiliency tests

This change makes the HTTP client transports more robust by ensuring exceptions
are properly propagated.

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
@tzolov tzolov marked this pull request as ready for review June 26, 2025 10:16
tzolov added 2 commits June 26, 2025 13:59
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Replace exceptionallyCompose with whenComplete for better async error handling
- Make ResponseSubscribers class package-private

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant