OptionalauthAuthentication configuration.
Enables OAuth 2.1 or custom token verification on the server. Only effective for HTTP-based transports.
OptionalcapabilitiesServer capabilities to advertise.
OptionalhealthReadiness endpoint configuration.
Provides a generic readiness check hook for the /ready endpoint.
Consumers supply their own check logic.
OptionallifecycleLifecycle hooks for startup/shutdown.
OptionalnameServer name displayed to MCP clients.
OptionalonCalled before the OpenTelemetry SDK is initialized.
Power users can use this callback to configure low-level OTEL APIs before the framework creates the NodeSDK instance. Common use cases:
DiagLogger via diag.setLogger() for SDK-level
diagnostics (by default no DiagLogger is set — output is suppressed)The callback runs after framework config resolution but before
OTEL_LOG_LEVEL is consumed from process.env and SDK construction.
Important: Custom DiagLoggers must NOT write to stdout (reserved for MCP protocol data in stdio transport mode).
OptionalsessionSession management configuration.
Fine-tune session lifecycle (timeouts, cleanup, capacity). Only effective for HTTP-based transports.
OptionalshutdownShutdown configuration.
OptionaltelemetryEnable OpenTelemetry integration.
When not set, falls back to OTEL_ENABLED env var or config file.
Set explicitly to true or false to override the config.
OptionaltransportTransport configuration.
When omitted, transport mode is resolved from the config cascade:
schema defaults → .env file → config file → environment variables.
Host and port are always resolved from the config cascade
(MCP_BIND_HOST, MCP_PORT) regardless of whether transport is set.
OptionalversionServer version.
Options for createServer() - simplified high-level API.
This interface provides sensible defaults while allowing customization. All fields are optional except for name and version (which have defaults).
Example