Add start() to Transport interface

This commit is contained in:
Justin Spahr-Summers 2024-10-11 16:13:07 +01:00
commit 87ae7ffc5a
No known key found for this signature in database
GPG key ID: E78498BF3C053CA7

View file

@ -4,6 +4,13 @@ import { JSONRPCMessage } from "../types.js";
* Describes the minimal contract for a MCP transport that a client or server can communicate over.
*/
export interface Transport {
/**
* Starts 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.
*/
start(): Promise<void>;
/**
* Sends a JSON-RPC message (request or response).
*/