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

    Function optionalCommaSeparatedList

    • Zod schema for optional comma-separated string list env vars.

      Like commaSeparatedList, but returns undefined when the input is empty or produces no items after trimming. The resulting field type is string[] | undefined.

      Use for optional list fields where absence has semantic meaning (e.g., "use defaults" for allowed origins/hosts).

      Returns ZodOptional<ZodEffects<ZodString, string[] | undefined, string>>

      Zod schema that outputs string[] | undefined

      // In env schema:
      MCP_ALLOWED_ORIGINS: optionalCommaSeparatedList(),
      MCP_ALLOWED_HOSTS: optionalCommaSeparatedList(),