class

ModelContextProtocol::Transport::HttpTransport

Inherits ModelContextProtocol::Transport::Base < Reference < Object

Implementation of MCP transport using HTTP+SSE

Constructors

new(host : String, port : Int32)

Initialize as client

Source
new(server : HTTP::Server)

Initialize as server

Source

Instance methods

close

Close all connections

Source
on_notification

Register a handler for incoming notifications via SSE

Source
on_request

Register a handler for incoming requests via SSE

Source
send_notification(notification : Messages::Notification) : Nil

Send a notification via HTTP POST (no response expected)

Source
send_request(request : Messages::Request) : Messages::Response

Send a request via HTTP POST and wait for response

Source