MCP Server Framework - v1.0.0
    Preparing search index...

    Interface CreateServerOptions

    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).

    // Minimal - just use auto-registered tools
    const server = createServer({
    name: 'my-server',
    version: '1.0.0',
    transport: { mode: 'stdio' },
    });
    interface CreateServerOptions {
        auth?: AuthOptions;
        capabilities?: ServerCapabilities;
        health?: HealthConfig<ServiceClient>;
        lifecycle?: ServerLifecycleHooks;
        name?: string;
        onBeforeTelemetryInit?: () => void;
        session?: SessionConfigOptions;
        shutdown?: Partial<ShutdownConfig>;
        telemetry?: boolean;
        transport: TransportOptions;
        version?: string;
    }
    Index

    Properties

    Authentication configuration.

    Enables OAuth 2.1 or custom token verification on the server. Only effective for HTTP-based transports.

    AuthOptions

    capabilities?: ServerCapabilities

    Server capabilities to advertise.

    { tools: { listChanged: true }, logging: true }
    

    Health endpoint configuration for API connectivity monitoring.

    Wires a ConnectionStateManager to the /ready endpoint so readiness probes reflect the actual API connection state.

    HealthConfig

    Lifecycle hooks for startup/shutdown.

    name?: string

    Server name displayed to MCP clients.

    'mcp-server'
    
    onBeforeTelemetryInit?: () => void

    Called 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:

    • Set a custom DiagLogger via diag.setLogger() for SDK-level diagnostics (by default no DiagLogger is set — output is suppressed)
    • Register custom instrumentation
    • Configure global propagators or samplers

    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).

    ServerOptions.onBeforeTelemetryInit for the full documentation

    Session management configuration.

    Fine-tune session lifecycle (timeouts, cleanup, capacity). Only effective for HTTP-based transports.

    SessionConfigOptions

    shutdown?: Partial<ShutdownConfig>

    Shutdown configuration.

    telemetry?: boolean

    Enable 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.

    undefined (falls back to OTEL_ENABLED)
    
    transport: TransportOptions

    Transport configuration (required).

    Explicitly specify how the server communicates with clients. Use { mode: 'stdio' } for CLI usage or { mode: 'http' } for network usage.

    TransportOptions for details

    version?: string

    Server version.

    '1.0.0'