Add MCP Streamable HTTP specification support for the client#210
Open
keisku wants to merge 3 commits intomodelcontextprotocol:mainfrom
Open
Add MCP Streamable HTTP specification support for the client#210keisku wants to merge 3 commits intomodelcontextprotocol:mainfrom
keisku wants to merge 3 commits intomodelcontextprotocol:mainfrom
Conversation
atesgoral
reviewed
Jan 10, 2026
scutuatua-crypto
approved these changes
Jan 10, 2026
Contributor
Author
|
@atesgoral Thanks for reviewing this! I've addressed it. |
Contributor
Author
|
@atesgoral Any chance you could take a look at this PR? |
koic
reviewed
Jan 26, 2026
koic
reviewed
Mar 6, 2026
koic
reviewed
Mar 6, 2026
koic
reviewed
Mar 6, 2026
koic
reviewed
Mar 6, 2026
Member
|
@keisku Could you review the feedback and squash the commits into a single commit? |
b91a9db to
2ee2be4
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When an SSE stream is active, the server responds with 202 Accepted (no Content-Type, empty body) to POST requests, delivering the actual response via the SSE stream. Previously this raised an unsupported Content-Type error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2ee2be4 to
eb801cc
Compare
Contributor
|
Commits:
|
- Move event_stream_parser from Gemfile to gemspec as runtime dependency - Add brief descriptions to TODO comments in client/http.rb and streamable_http_transport.rb - Add description to spec URL comment in client.rb - Use SESSION_ID_HEADER constant for session ID header lookup in connect Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
eb801cc to
ae64c6a
Compare
This was referenced Apr 4, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Motivation and Context
Implements the MCP Streamable HTTP specification for the Ruby SDK client.
Rebased from #210 (original by @keisku) with merge conflict resolution, bug fixes, and review feedback addressed.
Already supported:
Accept: application/json, text/event-streamheaderapplication/jsonresponseThis PR adds:
text/event-stream(SSE) response viaevent_stream_parsergemMCP-Session-Idheader)MCP-Protocol-Version)conformance/client.rb)How Has This Been Tested?
Unit tests — 59 tests pass (40 client + 19 HTTP transport):
Conformance tests — core client scenarios pass:
E2E — manual testing with
examples/streamable_http_server.rbandexamples/streamable_http_client.rb.Breaking Changes
None. The public
send_request(request:)method signature is preserved for backward compatibility.Types of changes
Checklist
API Design
MCP::Client::HTTP#send_request(request:)— Returns body only (backward compatible)MCP::Client::HTTP#post(body:, headers:)— ReturnsResponsestruct with body + headers (for session management)MCP::Client::HTTP#delete(headers:)— For session terminationMCP::Client#connect(client_info:, protocol_version:, capabilities:)— Initialization handshakeMCP::Client#close— Session terminationPending TODOs
Last-Event-IDheader