Module: MCPClient::ServerStreamableHTTP::JsonRpcTransport

Includes:
HttpTransportBase
Included in:
MCPClient::ServerStreamableHTTP
Defined in:
lib/mcp_client/server_streamable_http/json_rpc_transport.rb

Overview

JSON-RPC request/notification plumbing for Streamable HTTP transport This transport uses HTTP POST requests but expects Server-Sent Event formatted responses

Constant Summary collapse

MAX_DECOMPRESSED_BODY_BYTES =

Default ceiling on the expanded size of a gzip-encoded response body. The peer controls the compression ratio, so without a bound a tiny compressed response ("gzip bomb") could expand to an arbitrarily large string and exhaust host memory before JSON parsing.

Hosts that legitimately exchange very large payloads (e.g. base64 resource blobs or audio) can raise it per server with the max_decompressed_body_bytes option, so that whether a response is accepted does not depend on the server's choice to gzip it.

64 * 1024 * 1024
DECOMPRESS_CHUNK_BYTES =
64 * 1024

Constants included from HttpTransportBase

HttpTransportBase::AUTH_PARAM, HttpTransportBase::AUTH_PARAMS_RUN

Constants included from JsonRpcCommon

JsonRpcCommon::NON_IDEMPOTENT_METHODS

Method Summary

Methods included from HttpTransportBase

#resend_after_session_restart, #rpc_notify, #rpc_request, #send_cancellation_notification, #terminate_session, #valid_server_url?, #valid_session_id?

Methods included from JsonRpcCommon

#build_jsonrpc_notification, #build_jsonrpc_request, #build_named_request_params, #cancellable_request?, #client_capabilities, #client_info_payload, #declare_sampling_tools, #describe_body_size, #describe_jsonrpc_message, #describe_parse_error, #initialization_params, #ping, #process_jsonrpc_response, #registered_callback?, #sampling_tools_supported?, #split_request_meta, #validate_protocol_version!, #with_retry