import express from 'express'; import { type CorsOptions, type HttpMethod, type ServerRequestHandler } from '../../common'; import type { SecurityOptions } from '../../common/types/options/http/interfaces'; import { HostServerAdapter } from './base.host.adapter'; /** * Default request body size for the Express host. Lifts body-parser's silent * 100KB default, which routinely rejected base64-encoded PDFs, DOCXes, and * large HTML inputs before they reached MCP tool handlers (issue #410). */ export declare const DEFAULT_EXPRESS_BODY_LIMIT = "4mb"; /** * Options for ExpressHostAdapter. */ export interface ExpressHostAdapterOptions { /** * CORS configuration. * At the adapter level, CORS is disabled by default (no middleware installed). * Note: FrontMcpServerInstance provides a permissive default when `cors` is omitted. */ cors?: CorsOptions; /** * Security options for transport hardening. * Includes bind address and DNS rebinding protection. */ security?: SecurityOptions; /** * Maximum body size for `express.json()`. Accepts a number of bytes or a * body-parser-compatible string ('4mb', '500kb', etc.). Defaults to '4mb'. */ bodyLimit?: number | string; /** * Maximum body size for `express.urlencoded()`. Falls back to `bodyLimit` * when omitted. */ urlencodedLimit?: number | string; } export declare class ExpressHostAdapter extends HostServerAdapter { private app; private router; private prepared; constructor(options?: ExpressHostAdapterOptions); registerRoute(method: HttpMethod, path: string, handler: ServerRequestHandler): void; registerMiddleware(entryPath: string, handler: ServerRequestHandler): void; enhancedHandler(handler: ServerRequestHandler): (req: express.Request, res: express.Response, next: express.NextFunction) => void | Promise; /** * Prepares the Express app with routes but does NOT start the HTTP server. * Used for serverless deployments (Vercel, AWS Lambda, etc.) * This method is idempotent - safe to call multiple times. */ prepare(): void; /** * Returns the Express app for serverless exports. * Automatically calls prepare() to ensure routes are registered. */ getHandler(): express.Application; start(portOrSocketPath: number | string, bindAddress?: string): Promise; private cleanupStaleSocket; } //# sourceMappingURL=express.host.adapter.d.ts.map