OptionaloncloseCallback for when the connection is closed for any reason.
This should be invoked when close() is called as well.
OptionalonerrorCallback for when an error occurs.
Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
OptionalonmessageOptionalsessionThe session ID generated for this connection.
OptionalsetSets the protocol version used for the connection (called when the initialize response is received).
OptionalsetSets the supported protocol versions for header validation (called during connect). This allows the server to pass its supported versions to the transport.
Closes the connection.
Sends a JSON-RPC message (request or response).
If present, relatedRequestId is used to indicate to the transport which incoming request to associate this outgoing message with.
Optionaloptions: TransportSendOptionsStarts processing messages on the transport, including any connection steps that might need to be taken.
This method should only be called after callbacks are installed, or else messages may be lost.
NOTE: This method should not be called explicitly when using Client or Server classes, as they will implicitly call start().
Describes the minimal contract for an MCP transport that a client or server can communicate over.