import { type McpServerFactory } from '@modelcontextprotocol/server'; export interface HttpBindOptions { host: string; token?: string; } export interface HttpGuardOptions extends HttpBindOptions { port: number; allowed_origins: string[]; allowed_hosts?: string[]; } export type FetchHandler = (req: Request, opts?: unknown) => Promise; /** * Returns an error message when the HTTP bind must be refused, undefined when allowed. * A non-loopback bind requires MCP_HTTP_TOKEN. */ export declare function validateHttpBind(options: HttpBindOptions): string | undefined; export declare function guardHttpFetch(next: FetchHandler, options: HttpGuardOptions): FetchHandler; export interface HttpServeOptions extends HttpGuardOptions { onerror?: (error: Error) => void; } export interface HttpServerHandle { close(): Promise; } /** * Serve MCP over Streamable HTTP on `host:port`: both protocol eras (legacy * traffic stateless), each request behind the bearer/Host/Origin guards. * Refuses a non-loopback bind without a token before listening. */ export declare function serveHttp(factory: McpServerFactory, options: HttpServeOptions): Promise; //# sourceMappingURL=http.d.ts.map