Skip to main content

Configuration

The Zscaler MCP Server reads configuration from a .env file in the working directory, environment variables, or CLI flags (in that order of precedence — CLI flags win).

Minimum required

Create a .env file in your project root:

ZSCALER_CLIENT_ID=your_client_id
ZSCALER_CLIENT_SECRET=your_client_secret
ZSCALER_VANITY_DOMAIN=your_vanity_domain
ZSCALER_CUSTOMER_ID=your_customer_id
warning

Never commit .env to source control. Add it to your .gitignore. For production deployments, use a managed secrets store — see Secrets Manager integration.

Zscaler API credentials

VariableRequiredDescription
ZSCALER_CLIENT_IDZidentity OneAPI client ID
ZSCALER_CLIENT_SECRET✅*Zidentity OneAPI client secret
ZSCALER_PRIVATE_KEY✅*PEM-encoded private key (JWT auth, alternative to CLIENT_SECRET)
ZSCALER_VANITY_DOMAINYour Zidentity vanity domain (e.g. acme)
ZSCALER_CUSTOMER_IDZPA onlyYour Zscaler customer/tenant ID — required when calling ZPA tools
ZSCALER_CLOUDoptionalCloud override (e.g. beta, zscalertwo)
ZSCALER_MCP_USER_AGENT_COMMENToptionalAppended to the SDK's User-Agent header

* Either ZSCALER_CLIENT_SECRET or ZSCALER_PRIVATE_KEY is required.

See Authentication for how to create these credentials.

Server & transport

VariableDefaultDescription
ZSCALER_MCP_TRANSPORTstdioTransport mode: stdio, sse, streamable-http
ZSCALER_MCP_HOST127.0.0.1Bind address for HTTP transports
ZSCALER_MCP_PORT8000Listen port for HTTP transports
ZSCALER_MCP_DEBUGfalseEnable debug logging
ZSCALER_MCP_LOG_TOOL_CALLSfalseLog every tool invocation (args, duration, result summary)

Service & tool selection

VariableDefaultDescription
ZSCALER_MCP_SERVICESallComma-separated services to enable: zia,zpa,zdx,zcc,ztw,zid,zeasm,zins,zms
ZSCALER_MCP_DISABLED_SERVICESnoneComma-separated services to exclude
ZSCALER_MCP_DISABLED_TOOLSnoneComma-separated tool patterns (supports fnmatch wildcards)
ZSCALER_MCP_TOOLSETS(all enabled)Comma-separated toolset ids — default or all are special. See Toolsets
ZSCALER_MCP_DISABLE_ENTITLEMENT_FILTERfalseSkip the OneAPI entitlement filter

Write operations

VariableDefaultDescription
ZSCALER_MCP_WRITE_ENABLEDfalseGlobal unlock for write tools
ZSCALER_MCP_WRITE_TOOLS(none)Mandatory allowlist — comma-separated patterns with wildcards
ZSCALER_MCP_SKIP_CONFIRMATIONSfalseBypass HMAC confirmation tokens (use only in CI/CD)
ZSCALER_MCP_CONFIRMATION_TTL300Confirmation token TTL (seconds)

See Write operations for the full safety model.

HTTP-only security

These variables only apply to sse and streamable-http transports:

VariableDefaultDescription
ZSCALER_MCP_AUTH_ENABLEDautoEnable MCP client authentication
ZSCALER_MCP_AUTH_MODE(auto-detect)api-key, jwt, or zscaler
ZSCALER_MCP_AUTH_API_KEYShared secret (api-key mode)
ZSCALER_MCP_AUTH_JWKS_URIJWKS endpoint (JWT mode)
ZSCALER_MCP_AUTH_ISSUERExpected token issuer (JWT mode)
ZSCALER_MCP_AUTH_AUDIENCEExpected token audience (JWT mode)
ZSCALER_MCP_TLS_CERTFILETLS certificate path
ZSCALER_MCP_TLS_KEYFILETLS key path
ZSCALER_MCP_ALLOW_HTTPfalsePermit plaintext HTTP on non-localhost
ZSCALER_MCP_ALLOWED_HOSTSComma-separated allowed Host header values
ZSCALER_MCP_ALLOWED_SOURCE_IPSComma-separated allowed client IPs/CIDRs
ZSCALER_MCP_DISABLE_HOST_VALIDATIONfalseSkip host header validation

See TLS & hardening for details.

CLI flags

Every environment variable above has an equivalent CLI flag. Run zscaler-mcp --help for the complete list. CLI flags always override environment variables.

zscaler-mcp --help

Common flags:

  • --transport stdio|sse|streamable-http
  • --services zia,zpa,zdx
  • --disabled-services zcc
  • --toolsets zia_url_filtering,zpa_app_segments
  • --enable-write-tools --write-tools "zpa_create_*,zia_update_*"
  • --host 0.0.0.0 --port 8080
  • --log-tool-calls
  • --list-tools — print every registered tool and exit
  • --version

Lifecycle subcommands

The CLI exposes four subcommands for managing a running server:

  • zscaler-mcp status — show PID, uptime, transport, port, .env path
  • zscaler-mcp reload — soft reload via SIGHUP (re-reads .env, sessions survive)
  • zscaler-mcp restart — hard restart via SIGUSR2 + execvp (sessions die, fresh process)
  • zscaler-mcp stop — clean shutdown via SIGTERM

These work locally and inside containers — see the Docker deployment guide for the bind-mount pattern that makes live .env reloading work in production.