import { Express } from "express"; import { Server } from "http"; export type Backend = "tomtom-orbis-maps" | "tomtom-maps"; export interface HttpServerOptions { port?: number; fixedBackend?: Backend | null; defaultBackend?: Backend; allowedOrigins?: string; } export interface HttpServerResult { app: Express; httpServer: Server; shutdown: () => Promise; } /** * Resolves backend configuration from environment variable. * Returns the fixed backend if MAPS env is set to a valid value, otherwise null for dual mode. */ /** * Builds an RFC 9728 WWW-Authenticate Bearer challenge that points to the * MCP server's OAuth protected-resource metadata endpoint. Optional `error` * / `description` follow RFC 6750. */ export declare function buildWwwAuthenticate(resourceMetadataUrl: string, opts?: { error?: string; description?: string; }): string; export declare function resolveFixedBackend(mapsEnv: string | undefined): Backend | null; /** * Determines the backend for a request based on fixed config or header. */ export declare function resolveBackendFromHeader(fixedBackend: Backend | null, headerValue: string | undefined, defaultBackend?: Backend): Backend; /** * Creates and starts the HTTP server. Exported for integration testing. * * Each incoming request gets its own McpServer + transport pair, created on-the-fly. * This ensures full isolation between concurrent requests — no shared state, no locking. * createServer() is lightweight (in-memory tool registration, no network calls). */ export declare function createHttpServer(options?: HttpServerOptions): Promise;