import { type JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js'; import { Request, Response } from 'express'; /** * Server transport for SSE using Express Response type. * Adapts the SSEServerTransport functionality to work with Express. */ export declare class ExpressSSEServerTransport { private _endpoint; private _sessionId; private _sseResponse?; onmessage?: (message: JSONRPCMessage) => void; onclose?: () => void; onerror?: (error: Error) => void; /** * Creates a new SSE server transport for Express. * @param _endpoint The endpoint where clients should POST messages */ constructor(_endpoint: string); /** * Sets up the SSE connection using Express Response. * This method should be called to handle the initial SSE request. */ handleSSERequest(res: Response): void; /** * Start the SSE connection - required by McpServer */ start(): Promise; /** * Handles incoming POST messages. */ handlePostMessage(req: Request, res: Response): Promise; /** * Handle a client message, regardless of how it arrived. */ handleMessage(message: JSONRPCMessage): Promise; /** * Close the SSE connection. */ close(): Promise; /** * Send a message over the SSE connection. */ send(message: JSONRPCMessage): Promise; /** * Returns the session ID for this transport. */ get sessionId(): string; } //# sourceMappingURL=expressSseTransport.d.ts.map