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)
SourceInstance methods
close
Clean up the transport and close all underlying client connections; renders the transport unusable permanently
mcp_protocol_version
Sourcemcp_protocol_version=(mcp_protocol_version : String | Nil)
Sourcemcp_session_id
Sourcenotify(body, & : JSON::Any | ErrorDetails -> )
Like #post but used to send notifications without expecting any reply. This matters in the legacy transport.
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.
uri
Source