Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introducing WebClient support for Streamable HTTP transport.
Motivation and Context
The 2025-03-26 specification of MCP introduces Streamable HTTP transport that replaces SSE transport.
This change introduces more resilient primitives that support the initial, WebClient-based client transport for Streamable HTTP.
Various failure modes at either the transport or logical layer have been addressed and are now fully supported by the new
WebClientStreamableHttpTransportclass. The surroundingMcpAsyncClientandMcpClientSessionhave been modified to handle possible issues according to the adequate layer's responsibility.Orientation
The existing APIs are organized quite logically with regards to various responsibilities using layers. Below is the status quo description and the changes required for Streamable HTTP to be implemented.
Rationale for the API
The client types are layered in the following way:
Here are the distinguishing features of these APIs:
McpAsyncClient(and the facade,McpSyncClient)Mcp(Client)SessionMcp(Client)TransportMcpTransportSessionMcpTransportStreamHow Has This Been Tested?
everythingMCP server.Breaking Changes
The client initialization became lazy and more error-prone - connections happen upon first request and initialization is performed implicitly if it has not been issued before.
Types of changes
Checklist
Additional context
The JDK HttpClient will be implemented next.
Remaining tasks
Related #72