class

MCPC::HttpLegacyTransport

Inherits MCPC::Transport < Reference < Object

MCP HTTP Legacy transport which uses two connections, a GET to receive and a POST to send.

Constants

OK_STATUS = [200, 202]

Constructors

new(url : String | URI, tracing = false, auth_token = nil)
Source

Instance methods

close

Clean up the transport and close all underlying client connections; renders the transport unusable permanently

Source
mcp_protocol_version
Source
mcp_protocol_version=(mcp_protocol_version : String | Nil)
Source
mcp_session_id
Source
notify(body, & : JSON::Any | ErrorDetails -> )

Like #post but used to send notifications without expecting any reply. This matters in the legacy transport.

Source
post(body, & : JSON::Any | ErrorDetails -> )

Send a request. Yields a JSON::Any for valid data: in the response, or ErrorDetails for unknown response. Listens for exception and retries the post with a new HTTP client exactly once.

Source