Merge pull request #459 from koic/bound_client_sse_event_buffering

Bound client-side message buffering in the HTTP transport
This commit is contained in:
Koichi ITO 2026-07-16 01:00:26 +09:00 • committed by GitHub
commit 7ebaf989d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2318,6 +2318,10 @@ response = client.call_tool(
The server will send `notifications/progress` back to the client during execution.
`MCP::Client::HTTP.new` accepts an optional `max_message_bytes:` keyword that caps the bytes buffered in memory for a single message from the server -
an SSE event or a JSON response body. A message that reaches this limit before completing is rejected as a transport error, preventing unbounded memory growth from
a server that never terminates an SSE event. It defaults to `4 * 1024 * 1024` (4 MiB); raise it if your server returns larger responses.
#### Server-to-Client Requests (Elicitation)
Servers can send requests back to the client while one of the client's own requests is in flight - for example,