@mcp-z/mcp-gmail
    Preparing search index...

    Function parseConfig

    • Parse Gmail server configuration from CLI arguments and environment.

      CLI Arguments (all optional):

      • --auth= Authentication mode (default: loopback-oauth) Modes: loopback-oauth, service-account, dcr
      • --headless Disable browser auto-open, return auth URL instead
      • --redirect-uri= OAuth redirect URI (default: ephemeral loopback)
      • --dcr-mode= DCR mode (self-hosted or external, default: self-hosted)
      • --dcr-verify-url= External verification endpoint (required for external mode)
      • --dcr-store-uri= DCR client storage URI (required for self-hosted mode)
      • --port= Enable HTTP transport on specified port
      • --stdio Enable stdio transport (default if no port)
      • --log-level= Logging level (default: info)
      • --storage-dir= Directory for CSV file storage (default: .mcp-z/files)
      • --base-url= Base URL for HTTP file serving (optional)

      Environment Variables:

      • GOOGLE_CLIENT_ID OAuth client ID (REQUIRED)
      • GOOGLE_CLIENT_SECRET OAuth client secret (optional)
      • AUTH_MODE Default authentication mode (optional)
      • HEADLESS Disable browser auto-open (optional)
      • DCR_MODE DCR mode (optional, same format as --dcr-mode)
      • DCR_VERIFY_URL External verification URL (optional, same as --dcr-verify-url)
      • DCR_STORE_URI DCR storage URI (optional, same as --dcr-store-uri)
      • PORT Default HTTP port (optional)
      • LOG_LEVEL Default logging level (optional)
      • STORAGE_DIR Default storage directory (optional)
      • BASE_URL Default base URL for file serving (optional)

      OAuth Scopes (from constants.ts): openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://mail.google.com/

      Parameters

      • args: string[]
      • env: Record<string, string | undefined>

      Returns ServerConfig