You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bee8724
Browse filesBrowse the repository at this point in the historyBrowse files
fix: apply max_message_bytes to remaining HTTP responses
Apply the configured response limit to notification acknowledgements,
replies to server-to-client requests, and session DELETE responses.
Count incoming bytes without parsing or retaining these bodies.
These discard reads do not load event_stream_parser.
Report an over-limit body as RequestHandlerError, as send_request does.
Check the size before DELETE status handling, and clear local session
state even when close raises.
Copy file name to clipboardExpand all lines: docs/_client/transports.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,10 @@ See the [Progress](/server/progress/) page.
131
131
132
132
`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 -
133
133
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
134
-
a server that never terminates an SSE event. It defaults to `4 * 1024 * 1024` (4 MiB); raise it if your server returns larger responses.
134
+
a server that never terminates an SSE event. The same limit applies to the bodies the client reads and drops: the acknowledgement of a notification or of a response
135
+
to a server-to-client request, and the answer to the session DELETE. These bodies are counted in full, regardless of content type, without parsing or loading
136
+
`event_stream_parser`. An over-limit DELETE reply raises a transport error before its status is handled, including 404 or 405; replies with those statuses
137
+
within the limit are still tolerated. It defaults to `4 * 1024 * 1024` (4 MiB); raise it if your server returns larger responses.
135
138
136
139
`MCP::Client::HTTP.new` also accepts `max_reconnection_wait:`, a budget in seconds for resuming a closed SSE stream. It gates every wait between reconnection attempts,
137
140
and what is left of it becomes the read timeout of each resumed stream. The server chooses that wait through the SSE `retry:` field, and resuming happens on the calling thread,
0 commit comments