import type { Transport, JSONRPCMessage } from '@modelcontextprotocol/server'; import type { Request, Response } from 'express'; /** * A custom Server Transport that implements the Legacy SSE (MCP 2024-11-05) protocol. * This is required because the official @modelcontextprotocol/server v2 package * removed stateful SSEServerTransport in favor of Streamable HTTP (MCP 2025-03-26). * This transport allows older clients (like SSEClientTransport) to connect using * `GET /sse` followed by `POST /messages`. */ export declare class LegacySSEServerTransport implements Transport { private messagesEndpoint; private res; sessionId: string; onclose?: () => void; onerror?: (error: Error) => void; onmessage?: (message: JSONRPCMessage) => void; constructor(messagesEndpoint: string, sessionId?: string); start(): Promise; close(): Promise; send(message: JSONRPCMessage): Promise; /** * Handles the initial GET request to establish the SSE stream. */ handleSseRequest(req: Request, res: Response): void; /** * Handles incoming POST requests containing JSON-RPC messages. */ handlePostMessage(req: Request, res: Response): void; } //# sourceMappingURL=legacy-sse.d.ts.map