Skip to main content
Glama
MCP ZAP Server

MCP ZAP Server

GitHub stars GitHub forks GitHub Tag GitHub License

Note This project is not affiliated with or endorsed by OWASP or the OWASP ZAP project. It is an independent implementation.

MCP ZAP Server

Give AI agents a safe, self-hosted OWASP ZAP operator for guided web security scans, findings, reports, and production guardrails.

mcp-zap-server exposes OWASP ZAP through MCP over streamable HTTP so agentic tools can run operator-controlled security workflows without brittle glue scripts or unsafe scanner access.

Use it when you want:

  • safe agentic scanning with guided defaults for spider, active scan, passive scan, API imports, findings, and reports

  • operator control through API-key or JWT auth, tool scopes, runtime policy bundles, rate limits, and audit events

  • self-hosted deployment with Docker Compose for local adoption and Helm for Kubernetes

  • expert ZAP access when you intentionally need lower-level ZAP context, user, scan, and report controls

Full documentation: danieltse.org/mcp-zap-server

Watch the demo: browser demo or YouTube

Quick Start

Prerequisites:

  • Docker 20.10+

  • Docker Compose v2 (docker compose)

  • an MCP-capable client, or the bundled Open WebUI client

git clone https://github.com/dtkmn/mcp-zap-server.git
cd mcp-zap-server

cp .env.example .env

# Generate values for ZAP_API_KEY and MCP_API_KEY, then put them in .env.
openssl rand -hex 32
openssl rand -hex 32

docker compose up -d

Then open:

  • Open WebUI: http://localhost:3000

  • MCP endpoint for host-side clients: http://localhost:7456/mcp

The default Compose stack publishes host ports on 127.0.0.1 only. Set MCP_ZAP_BIND_ADDRESS=0.0.0.0 only when you intentionally expose the stack behind trusted network controls.

Client setup:

Related MCP server: Security Scanner MCP Server

Discovery Metadata

This repository includes MCP Registry metadata in .mcp/server.json. The v0.8.0 Docker images are labeled with the MCP server name expected by registry and catalog tooling.

Docker Compose remains the easiest installation path because the MCP server is designed to operate with an OWASP ZAP sidecar and explicit auth keys. The OCI package metadata is for advanced standalone installs where OWASP ZAP is already running and reachable from the MCP container.

What You Get

  • Guided scans: intent-first tools for spider, active scan, passive scan, API imports, findings, reports, and scan history.

  • Expert ZAP control: optional lower-level tools for advanced ZAP context, user, scan, and report workflows.

  • Authentication: API key mode by default, optional JWT mode with refresh and revocation support.

  • Runtime policy bundles: dry-run and enforcement support through zap_policy_dry_run and policy-mode configuration.

  • Scan queue and history: queued active, spider, and AJAX Spider jobs with claim-based recovery, durable Postgres state, and evidence export.

  • Extension contracts: experimental policy, protection, evidence metadata, and extension metadata APIs with sample extension packaging.

  • Operational guardrails: request body limits, rate limits, workspace quotas, tool-scope authorization, structured logs, metrics, and audit events.

  • Deployment paths: local Docker Compose, production-oriented Compose, and Helm charts for Kubernetes.

Latest Release

v0.8.0 adds:

  • public-preview extension API publication and standalone extension examples

  • scan history release-evidence and customer-handoff tools

  • HA queue claim fencing, dispatcher/result-applier boundaries, and Postgres race coverage

  • Docker image packaging hardening, MCP Docker catalog labeling, and native-image port alignment

  • MCP Registry metadata and agent install notes for marketplace discovery

Read the full notes:

Security Defaults

The default posture is intentionally conservative:

  • api-key mode is the base runtime default.

  • none mode is for explicit local dev/test only.

  • Docker Compose binds published ports to loopback by default.

  • URL validation blocks localhost, private networks, and link-local targets by default.

  • Guided auth uses credential reference allowlisting for server-side secrets.

  • Public auth exchange endpoints are rate-limited.

  • MCP request bodies have a hard early size cap.

Production and shared deployments should review:

Architecture

flowchart LR
  Client["Open WebUI / MCP Client"] -->|"MCP over Streamable HTTP"| MCP["MCP ZAP Server"]
  MCP -->|"ZAP API"| ZAP["OWASP ZAP"]
  ZAP -->|"scan"| Target["Authorized target app"]
  MCP -->|"reports / findings / history"| Evidence["Evidence + reports"]

For multi-replica queueing, durable Postgres state, claim recovery, and ingress affinity, use the operations docs instead of this README:

Extension Model

ZAP is the first scanner engine, not the whole product boundary. The current public extension work is intentionally small:

This is not runtime multi-engine support yet. Additional scanner engines need an adapter design and explicit fail-closed capability boundaries before they become product claims.

Documentation Map

Start here:

Scanning:

Operations:

Open Source Core And Extension Model

mcp-zap-server is the Apache-2.0-licensed open-source core. It is intended to be useful on its own for self-hosted MCP and OWASP ZAP workflows.

Private or enterprise capabilities may be built as separate extensions around this core. Those extensions are not required to run the OSS project, and enterprise implementation code is not shipped in this repository.

The boundary is intentional:

  • this repository remains the public OSS distribution

  • extension points should be documented and kept stable where practical

  • private extensions must not weaken the security, licensing, or usability of the OSS core

  • security scanning and open-source program entitlements for this repository apply only to this public project

Contributing And Support

If this project saves you time or becomes part of your security workflow, you can sponsor the maintainer to support ongoing maintenance.

Agentic Lab offers optional paid support for teams adopting the public core in production. Commercial support is separate from the Apache-2.0-licensed OSS distribution, and the public core should remain usable without private extensions or paid services.

Contact Agentic Lab

License

Apache License 2.0. Copyright 2025-2026 Daniel Tse. See LICENSE.

Available Tools

21 tools
zap_attack_startA

Start a guided active scan for a specific target host or base URL after crawl/import setup. The server decides direct versus queued execution from deployment topology. When authSessionId is supplied, guided attack currently accepts prepared form-login sessions only.

Inputs: targetUrl (required), policy, recurse, authSessionId, +1 more.

zap_attack_statusA

Get status for a guided active-scan operation.

Inputs: operationId (required).

zap_attack_stopA

Stop a guided active-scan operation.

Inputs: operationId (required).

zap_auth_session_prepareB

Prepare a guided auth session from an operator-managed profile. Use a kind=browser profile for Client Spider, or kind=form for HTTP spider and active scans. The requested target must remain on the profile's authorized origin.

Inputs: profileId (required), targetUrl (required).

zap_auth_session_validateA

Validate a prepared guided auth session before authenticated crawl or attack flows.

Inputs: sessionId (required).

zap_crawl_startA

Start a guided crawl for a target host or root URL. The server decides direct versus queued execution from deployment topology. Use strategy=http for traditional server-rendered sites, strategy=client for JavaScript-driven apps using Client Spider, or strategy=browser for the existing AJAX Spider API. strategy=auto starts with HTTP Spider; only an unauthenticated direct HTTP start failure triggers AJAX fallback. Auto does not detect JavaScript coverage. Client Spider requires the Client Side Integration add-on and headless Firefox. Prepared browser authentication sessions require strategy=client; prepared HTTP form-login sessions require http or auto.

Inputs: targetUrl (required), strategy, authSessionId, idempotencyKey.

zap_crawl_statusB

Get status for a guided crawl operation.

Inputs: operationId (required).

zap_crawl_stopB

Stop a guided crawl operation.

Inputs: operationId (required).

zap_findings_detailsA

Drill into findings after reading the summary. Requires a nonblank target baseUrl covered by scan evidence visible to the caller. By default this returns grouped details for matching alerts. Set includeInstances=true when you need bounded raw alert occurrences with concrete URLs, params, evidence, or attack samples.

Inputs: baseUrl (required), limit, pluginId, alertName, +1 more.

zap_findings_summaryA

Read currently recorded alerts, including while scan work is in progress, as a concise grouped risk summary for fast triage. Alert counts do not establish scan completion, coverage, or safety. Requires a nonblank target baseUrl covered by scan evidence visible to the caller.

Inputs: baseUrl (required).

zap_passive_scan_statusB

Get passive scan backlog and completion status.

Inputs: no named parameters.

zap_passive_scan_waitA

Wait for the passive scan backlog to drain before reading findings or generating reports.

Inputs: pollIntervalMs, timeoutSeconds.

zap_report_generateA

Generate a human-shareable report artifact using guided defaults. Use this after passive scan backlog drains when you want an export or handoff artifact; use findings summary/details for interactive triage.

Inputs: theme, format, baseUrl.

zap_report_readA

Preview a generated report artifact through MCP after zap_report_generate. If truncated, use zap_report_read_chunk to retrieve the complete artifact in bounded pages.

Inputs: reportPath (required), maxChars.

zap_report_read_chunkA

Retrieve a generated UTF-8 report in bounded JSON pages. Append content in order, follow nextOffset until endOfFile=true, and supply the first page's artifactSha256 as expectedSha256 on later pages. Offsets and maxChars count Unicode code points. Artifacts are limited to 50 MiB; the SHA-256 identifies the full original UTF-8 file.

Inputs: reportPath (required), offset, maxChars, expectedSha256.

zap_scan_history_customer_handoffA

Generate a customer-safe Markdown handoff summary from scan history without raw internal IDs, backend references, workspace IDs, or metadata.

Inputs: limit, target, handoffName.

zap_scan_history_exportA

Export scan history as inline JSON text for internal evidence processing; no export file is created. Use zap_scan_history_list for a readable listing, zap_scan_history_release_evidence for a summary bundle, or zap_scan_history_customer_handoff for a customer-facing summary. Returns version, generatedAt, retentionDays, entryCount, and entries containing scan/job/artifact records, including internal IDs, paths, and metadata; review before sharing. Only records accessible to the caller in the current workspace are included, newest first. Omitted or blank filters select all accessible records; supplied filters combine with AND. The snapshot is capped by limit, has no pagination, and returns an empty entries array when nothing matches. It does not start scans or contact targets. Querying may delete expired stored ledger entries under the configured retention policy; it does not refresh scan outcomes from ZAP.

Inputs: limit, status, target, evidenceType.

zap_scan_history_getA

Read one scan history or release-evidence entry by ID.

Inputs: entryId (required).

zap_scan_history_listA

List recent scan history and release-evidence entries, including queued scans, direct scan starts, and generated report artifacts.

Inputs: limit, status, target, evidenceType.

zap_scan_history_release_evidenceB

Export a release or pilot handoff evidence bundle with summary counts, target coverage, warnings, and bounded ledger entries.

Inputs: limit, target, releaseName.

zap_target_importA

Import an OpenAPI/Swagger definition, GraphQL schema, or SOAP WSDL to prepare API endpoints for testing. Use when you have an API definition; use zap_crawl_start to discover ordinary web pages. Requires a reachable, configured ZAP instance with the matching OpenAPI, GraphQL, or SOAP add-on. Import changes the current ZAP session and may send requests to the definition source and API targets; use only authorized targets. It does not start an active scan: after reviewing import messages, call zap_attack_start with the API target URL only when active testing is permitted and approved. Content mode accepts actual OpenAPI JSON/YAML text with a required full HTTP(S) hostOverride and an explicitly enabled shared filesystem; it cannot read chat attachments automatically. Returns plain text containing definition type, source kind, and import status. URL/file mode also includes source and engine messages; content mode withholds contents, internal paths, and raw engine warning text. Review warnings before proceeding. Invalid inputs, blocked URLs, and ZAP API failures raise errors.

Inputs: source (required), sourceKind (required), definitionType (required), endpointUrl, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 21 tools

    Disambiguation4/5

    Crawl, attack, passive scan, auth, report, findings, and history operations are generally well separated by distinct resource+action names. The main overlap is within scan history (list/get/export/release_evidence/customer_handoff) and report_read vs report_read_chunk, but descriptions clarify their roles. A few boundary cases remain, such as choosing among history export variants, which adds mild confusion.

    Naming Consistency5/5

    All tools consistently use the zap_ prefix followed by snake_case resource/action naming (e.g., zap_crawl_start, zap_attack_stop, zap_findings_summary). Verb and resource ordering is predictable throughout, with no mixed casing or style deviations.

    Tool Count4/5

    At 21 tools, the count is on the heavy side but reasonable for a security scanning domain that must cover crawl, attack, auth, reports, findings, import, and history workflows. Each tool appears to serve a distinct lifecycle operation, though the history surface is somewhat expansive.

    Completeness4/5

    The surface covers the core lifecycle well: crawl/attack start-stop-status, passive scan wait/status, auth prepare/validate, target import, findings summary/details, report generation/reading, and history inspection/export. Minor gaps exist, such as no explicit alert disposition/false-positive management or session cleanup/configuration tools, but core workflows are covered.

    Maintenance

    ActivityActive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Integrates OWASP ZAP security testing with AI assistants through MCP, enabling automated vulnerability scanning and AI-powered security analysis during development. Supports multiple scan types including active, passive, and AJAX spider scans with real-time status updates.
      5
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A lightweight MCP server that wraps OWASP ZAP's REST API as Model Context Protocol tools, enabling AI agents to perform automated security scanning.
      -