/** * Streamable HTTP transport (opt-in). It binds to the loopback interface only, * answers every POST to `/mcp` with a single JSON response (no SSE, no * sessions) and rejects requests whose `Host` or `Origin` is not local, which * blocks DNS-rebinding attacks from web pages. An optional bearer token * additionally keeps other local users and processes out. * @module mcp/http */ /** The only interface the server listens on. */ export declare const HTTP_HOST = "127.0.0.1"; /** Path of the MCP endpoint. */ export declare const HTTP_PATH = "/mcp"; export type HttpOptions = { /** * TCP port; 0 picks a free one. */ port: number; /** * Require `Authorization: Bearer `. */ authToken?: string; log?: (message: string) => void; }; export type HttpHandle = { /** * The port actually bound. */ port: number; /** * Endpoint URL. */ url: string; /** * Stop listening and close the MCP server. */ close: () => Promise; }; /** * Listen on `127.0.0.1:`. * @param {import("./server.mjs").McpServer} server * @param {HttpOptions} options * @returns {Promise} */ export declare function serveHttp(server: import("./server.mjs").McpServer, options: HttpOptions): Promise;