/** * Streamable-HTTP transport for the MCP server (issue #4). * * Hosts the MCP protocol over HTTP using the SDK's * `StreamableHTTPServerTransport`. Built on Node's stdlib `http` module so we * don't pull in Express just to forward requests. Two operations: * * POST /mcp — JSON-RPC requests/responses * GET /healthz — liveness probe (200 OK with version) * * Multiple sessions are supported via the `Mcp-Session-Id` header — each * session keeps its own transport so concurrent clients don't tread on each * other. Session lifecycle is fully owned by the SDK; we just route. */ import { type Server as HttpServer } from "node:http"; import type { Server as McpServer } from "@modelcontextprotocol/sdk/server/index.js"; import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; export interface HttpTransportOptions { port: number; host?: string; /** Connect callback invoked once per new session — wires the McpServer to the transport. */ connect: (transport: StreamableHTTPServerTransport) => Promise; } export interface HttpTransportHandle { server: HttpServer; close: () => Promise; } export declare function startHttpTransport(opts: HttpTransportOptions): Promise; /** * Use the McpServer high-level Server class — it accepts any Transport. * Bridge helper kept for callers wiring an existing McpServer instance. */ export declare function bindMcpServer(mcpServer: McpServer, transport: StreamableHTTPServerTransport): Promise; //# sourceMappingURL=http.d.ts.map