Either a ready-made McpServer instance or a factory called
once per request. A factory is what serves both protocol eras from the same definitions;
an instance is served through a factory that always returns it (fine for a stateless server).
OptionalallowedHosts?: string[]Extra Host values to accept, added to the loopback set for port
OptionalallowedOrigins?: string[]Extra Origin values to accept, added to the loopback set for port
Optionalhost?: stringInterface to bind to (spec SHOULD: loopback-only); pass '0.0.0.0' only for a deployment that genuinely needs it, e.g. behind a reverse proxy
HTTP server instance
Sets up HTTP transport for an MCP server: creates the router, mounts it at
/mcp, and binds an HTTP server.