Squashed 'packages/mcp-typescript/' changes from dcc30be..e665be0

e665be0 Merge pull request #14 from modelcontextprotocol/justin/fix-race-condition
be9c1fe Merge branch 'main' into justin/fix-race-condition
36ba802 Merge pull request #17 from modelcontextprotocol/ashwin/capabilities
a1b8886 yarn build
7b718de Report errors when start() is called multiple times
83a43fd Protocol.connect() can automatically call Transport.start()
8d80cc5 Merge branch 'main' into justin/fix-race-condition
bcb4b21 add server capabilities derivation
e9c64fb Update tests and CLI
2b0599e Update server SSE transport
c39f808 Update client transports
87ae7ff Add start() to Transport interface

git-subtree-dir: packages/mcp-typescript
git-subtree-split: e665be068b9d2baa65f37fd7c2f69f68f77e57b9
This commit is contained in:
Ashwin Bhat 2024-10-16 16:12:48 -07:00
commit 23ca80ed66
No known key found for this signature in database

View file

@ -8,6 +8,7 @@ import { JSONRPCMessage } from "../types.js";
*/
export declare class SSEServerTransport implements Transport {
private _endpoint;
private res;
private _sseResponse?;
private _sessionId;
onclose?: () => void;
@ -16,13 +17,13 @@ export declare class SSEServerTransport implements Transport {
/**
* Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`.
*/
constructor(_endpoint: string);
constructor(_endpoint: string, res: ServerResponse);
/**
* Handles the initial SSE connection request.
*
* This should be called when a GET request is made to establish the SSE stream.
*/
connectSSE(req: IncomingMessage, res: ServerResponse): Promise<void>;
start(): Promise<void>;
/**
* Handles incoming POST messages.
*