Skip to main content

zscaler-dp-mcp: Data Protection MCP server for Zscaler (unofficial)

Unofficial community project. Not affiliated with, endorsed by, or supported by Zscaler, Inc. "Zscaler" is a trademark of its owner and is used here only to describe compatibility. Use at your own risk, and try it on a non-production tenant first.

An MCP server that lets AI assistants (Claude Desktop, VS Code Copilot, Cursor, Devin, ...) work with Zscaler Data Protection: ZIA DLP policy and Workflow Automation (ZWA) DLP incidents.

It covers all of Data Protection through one server, so you don't need to piece it together from other tools:

Area Read Write (opt-in)
Web, CASB (SaaS API), Outbound Email and Endpoint DLP rules ✓ create / update / delete
DLP dictionaries, engines, notification templates, rule labels ✓ create / update / delete
Web DLP global options ✓ update
ICAP servers, incident receivers, C2C receivers, IDM, EDM, endpoint custom apps ✓ read-only by API
Endpoint application groups and resource groups, email recipient profiles ✓ read-only in v0.1
ZIA activation status activate
ZWA incidents: search, details, triggers (masked), history, audit log ✓ notes, labels, close
Workflows: export / diff / audit / import (cross-tenant) / clone, incident digest ✓ import, clone
Prompts: incident triage, tenant-context builder, policy review ✓ –

Safety model

  • Read-only by default. Write tools are not even registered unless you start the server with --enable-writes and an allowlist (--write-tools). ZWA incident changes need their own flag, --enable-zwa-writes.
  • Two-phase writes. Every write first returns a preview: the exact payload and a field-by-field diff, plus a one-time confirm_token. Nothing changes until the same call is repeated with that token, and the token is rejected if the object changed in between.
  • Partial updates are safe. The ZIA API replaces whole objects on update; the server fetches the live object, merges your change and sends the full object, then reads it back and reports any field the API didn't apply.
  • Snapshots and audit log. A JSON snapshot is saved before every update or delete, and every write is appended to audit.jsonl (see State directory).
  • No silent activation. ZIA changes stay staged until you call zia_activate, which warns that activation pushes every pending change in the tenant.
  • Sensitive data masked. ZWA trigger values (the matched strings) are masked unless you pass --no-redact-triggers.

Install

Requires Python 3.11+ and uv.

uvx zscaler-dp-mcp --help

Or with Docker:

docker build -t zscaler-dp-mcp .
docker run --rm -i --env-file ./zscaler.env zscaler-dp-mcp           # stdio

Credentials

Variable Required Where to get it
ZSCALER_CLIENT_ID, ZSCALER_CLIENT_SECRET yes ZIdentity admin portal → Integration → API Clients. The client needs ZIA access with a role that can read (and, for writes, edit) DLP.
ZSCALER_VANITY_DOMAIN yes The <name> in https://<name>.zslogin.net (just the name, not the URL)
ZSCALER_CLOUD beta tenants only e.g. beta
ZWA_CLIENT_ID, ZWA_CLIENT_SECRET for incident tools Workflow Automation portal → API keys. This is a separate key; the OneAPI client does not work for ZWA.
ZWA_CLOUD / ZWA_URL if needed Only if your ZWA API host isn't https://api.us1.zsworkflow.net

Put them in a .env file (chmod 600) and pass --env-file, or set them in your MCP client's env block. Never paste secrets into a chat.

Client configuration

Claude Desktop (claude_desktop_config.json), Cursor (.cursor/mcp.json), Devin (~/.config/devin/mcp_config.json):

{
  "mcpServers": {
    "zscaler-dp": {
      "command": "uvx",
      "args": ["zscaler-dp-mcp", "--env-file", "/absolute/path/to/zscaler.env"]
    }
  }
}

VS Code (Copilot) (.vscode/mcp.json):

{
  "servers": {
    "zscaler-dp": {
      "type": "stdio",
      "command": "uvx",
      "args": ["zscaler-dp-mcp", "--env-file", "/absolute/path/to/zscaler.env"]
    }
  }
}

To allow changes, add flags to args, for example:

"args": ["zscaler-dp-mcp", "--env-file", "/path/zscaler.env",
         "--enable-writes", "--write-tools", "update:web_dlp_rule,*:dictionary,activate"]

--write-tools takes comma-separated globs over action:kind (create, update, delete, import, activate). * allows everything. Several tenants? Add one server entry per tenant, each with its own .env.

Shared HTTP deployment

ZDP_HTTP_TOKEN=$(openssl rand -hex 32) zscaler-dp-mcp --transport streamable-http --host 0.0.0.0 --port 8000 --env-file ...

Clients connect to http://<host>:8000/mcp with Authorization: Bearer <token>. Put it behind TLS.

All options

Flag Env Default
--env-file ZDP_ENV_FILE –
--toolsets ZDP_TOOLSETS all: web_dlp,casb_dlp,email_dlp,endpoint_dlp,resources,activation,zwa,workflows
--enable-writes ZDP_ENABLE_WRITES off
--write-tools ZDP_WRITE_TOOLS – (required with writes)
--enable-zwa-writes ZDP_ENABLE_ZWA_WRITES off
--no-redact-triggers ZDP_REDACT_TRIGGERS=false redaction on
--state-dir ZDP_STATE_DIR ~/.zscaler-dp-mcp
--min-interval ZDP_MIN_INTERVAL 1.0 s between API calls
--transport / --host / --port ZDP_TRANSPORT / ZDP_HOST / ZDP_PORT stdio / 127.0.0.1 / 8000
– ZDP_HTTP_TOKEN required for HTTP

State directory

~/.zscaler-dp-mcp/
  exports/                 policy bundles (shared by every tenant on this machine, so you can import across tenants)
  reports/                 incident digests (HTML + CSV)
  <tenant>/snapshots/      object JSON saved before every update/delete
  <tenant>/audit.jsonl     one line per write: who/what/outcome

Example requests

  • "List my Web DLP rules and tell me which ones block uploads to generative AI."
  • "Disable the rule 'Block PCI to personal email'." (shows a preview; you approve; then "activate")
  • "Export the DLP policy, then audit it and give me the top five fixes."
  • "Copy all DLP rules from this tenant to the lab tenant, but leave them disabled."
  • "Summarise yesterday's DLP incidents and triage the three newest high-severity ones."

Documentation

Development

uv sync --group dev
uv run pytest                        # unit tests (no tenant needed)
uv run ruff check src tests && uv run mypy src
ZDP_ENV_FILE=~/lab.env uv run pytest tests/integration -m integration -s          # live reads
ZDP_ENV_FILE=~/lab.env ZDP_LIVE_WRITES=1 uv run pytest tests/integration -m integration -s   # + self-cleaning writes

License

Apache-2.0

Metadata

Release files for zscaler-dp-mcp 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zscaler-dp-mcp 0.1.2
File Size Uploaded Provenance Actions
zscaler_dp_mcp-0.1.2.tar.gz 168.5 kB Without provenance Details for zscaler_dp_mcp-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zscaler-dp-mcp 0.1.2
File Interpreter ABI Platform Actions
zscaler_dp_mcp-0.1.2-py3-none-any.whl Python 3 none any Details for zscaler_dp_mcp-0.1.2-py3-none-any.whl

Total release size: 226.0 kB

Release files / zscaler_dp_mcp-0.1.2.tar.gz

Download URL zscaler_dp_mcp-0.1.2.tar.gz
Size 168.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c5311a3be5c0efcad671c6641dab58e37fef11891e9b385ed83ab7f74f999538
BLAKE2b-256 checksum
How to use checksums
4a8c15f6c4d8761066347daa6f7cd190e032a073c47ef23778bb8e35407e731a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / zscaler_dp_mcp-0.1.2-py3-none-any.whl

Download URL zscaler_dp_mcp-0.1.2-py3-none-any.whl
Size 57.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93cd403785c21e0401feebd00a4ebf205abd9262542529583e5f687954350a43
BLAKE2b-256 checksum
How to use checksums
ab7809938ba39c04daaa679366beedcd613cc9937700452e838c730c72551bc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for zscaler-dp-mcp 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page