Skip to content

Update Streamable HTTP client example to use MCP::Client#335

Merged
koic merged 1 commit intomodelcontextprotocol:mainfrom
atesgoral:ag/use-sdk-streamable-http-client-example
May 2, 2026
Merged

Update Streamable HTTP client example to use MCP::Client#335
koic merged 1 commit intomodelcontextprotocol:mainfrom
atesgoral:ag/use-sdk-streamable-http-client-example

Conversation

@atesgoral
Copy link
Copy Markdown
Contributor

@atesgoral atesgoral commented May 2, 2026

Summary

  • rewrite the Streamable HTTP client example to use MCP::Client for initialize, tools/list, and tools/call
  • keep raw Net::HTTP only for the optional GET SSE stream, which the SDK transport does not implement yet
  • adapt the superseded Add MCP Streamable HTTP specification support for the client #210 example rewrite to the current client API by reading session state from the HTTP transport and handling nil 202 ACK responses

Verification

  • ruby -c examples/streamable_http_client.rb
  • bundle exec rubocop --cache false examples/streamable_http_client.rb
  • ruby -I lib -e 'require "mcp"; require_relative "examples/streamable_http_client"; puts :loaded'
  • smoke-tested against examples/streamable_http_server.rb with scripted input

@atesgoral atesgoral force-pushed the ag/use-sdk-streamable-http-client-example branch from 9e3c971 to 933cf94 Compare May 2, 2026 14:09
@koic koic merged commit 541200f into modelcontextprotocol:main May 2, 2026
11 checks passed
@atesgoral atesgoral deleted the ag/use-sdk-streamable-http-client-example branch May 2, 2026 17:17
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.

2 participants