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

    Function booleanFromEnv

    • Zod schema for boolean environment variables.

      Accepts both native booleans (from config files) and string values from process.env. Only "true" (case-insensitive) maps to true, everything else maps to false.

      Parameters

      • defaultValue: boolean

        Default value when the env var is not set

      Returns ZodDefault<ZodUnion<[ZodBoolean, ZodEffects<ZodString, boolean, string>]>>

      Zod schema that outputs a boolean

      // In env schema:
      OTEL_ENABLED: booleanFromEnv(false),
      MCP_LEGACY_SSE_ENABLED: booleanFromEnv(false),