Uh oh!
There was an error while loading. Please reload this page.
Add MCP Streamable HTTP specification support for the client - #210
Add MCP Streamable HTTP specification support for the client#210keisku wants to merge 3 commits into
Conversation
Uh oh!
There was an error while loading. Please reload this page.
keisku
commented
Jan 15, 2026
@atesgoral Thanks for reviewing this! I've addressed it. |
keisku
commented
Jan 26, 2026
@atesgoral Any chance you could take a look at this PR? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
koic
commented
Mar 11, 2026
@keisku Could you review the feedback and squash the commits into a single commit? |
b91a9db to
2ee2be4CompareCo-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
eb801ccCompareatesgoral
commented
Apr 4, 2026
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
ae64c6aCompare| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } | ||
| spec.require_paths = ["lib"] | ||
| spec.add_dependency("event_stream_parser", ">= 1.0") |
There was a problem hiding this comment.
My previous comment may have overlooked some aspects.
EventStreamParser is only used in lib/mcp/client/http.rb. Considering how Faraday is currently handled, I'm not entirely certain, but it may be more consistent to make this an optional dependency that users include in their Gemfile when needed:
https://github.com/modelcontextprotocol/ruby-sdk/blob/v0.10.0/lib/mcp/client/http.rb#L84-L90
Assuming that many users of the SDK primarily use the server functionality, a setup similar to Faraday, where it is not a direct runtime dependency, may be more appropriate.
atesgoral
commented
May 2, 2026
@keisku thank you for kicking this off. This is now superseded by my fork + breaking down into smaller PRs. Marking this as done. |
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