import http from "http"; import type { Logger } from "../../logger.js"; import type { McpHandler } from "./adapter.js"; export declare const DEFAULT_MCP_PATH = "/mcp"; export declare const DEFAULT_MCP_PORT = 3545; export type McpHttpConfig = { /** JSON-RPC handler returned by createMcpHandler. */ handler: McpHandler; port: number; /** Interface to bind to. Default "127.0.0.1" (loopback only). */ host?: string; /** Path the MCP endpoint is mounted at. Default "/mcp". */ path?: string; apiKey?: string; /** * Allowed Host: header values (DNS-rebinding defense). If unset, defaults * follow the same rules as the REST adapter (loopback addresses for * loopback bind; skipped for non-loopback bind, where the mandatory API * key handles security). */ allowedHosts?: string[]; logger: Logger; /** * Lines listing the exposed tools (from `mcpToolSummaryLines`). Logged * once at startup, after the "listening on …" message. */ toolSummary?: string[]; }; /** * Start an MCP server using the Streamable HTTP transport. The transport * is intentionally minimal: * - POST {path} with a single JSON-RPC message → JSON response * - POST {path} with a JSON-RPC batch (array) → array of responses, or * 202 No Content if every message in the batch is a notification * - GET/DELETE {path} → 405 with `Allow: POST` (we have no * server-initiated messages, so SSE streams and session lifecycle are * not needed) * * Auth, host validation, body-size limits, and the no-key-on-non-loopback * guard are shared with the REST HTTP server via lib/serve/http/security.ts. */ export declare function startMcpHttpServer(config: McpHttpConfig): http.Server;