Handle streamable POSTs to properly support new streamable transport protocol spec #91
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.
The streamable http transport spec handles SSE a bit different than the original sse transport spec. In the original spec, POSTs returned their responses as sse messages on the GET stream. Now the POSTs themselves can sse streams so the GET becomes primarily for notifications (or resuming a POST that experienced a broken connection, but thats a separate can of worms that has not been properly addressed yet).
Motivation and Context
The current HTTPClientTransport does not support streams coming back from POSTs and it must to work with latest spec servers.
How Has This Been Tested?
We have 3 sandbox servers set up with latest server sdk from anthropic. Each configured differently to exercise expected variations.
// streaming response + session management
https://hgai-sandbox.aks.stage.mercury.io/streamable/mcp
// JSON response + session management
https://hgai-sandbox.aks.stage.mercury.io/streamable/json/mcp
// JSON response with no session management
https://hgai-sandbox.aks.stage.mercury.io/streamable/stateless/mcp
Breaking Changes
none
Types of changes
Checklist
Additional context
Supporting true resumability will require some additional work that was beyond the scope of this initial PR