OWASP ZAP MCP Server logo

OWASP ZAP MCP Server

MCP server for OWASP ZAP vulnerability scanning with Docker management

Install OWASP ZAP MCP Server

Run the project’s own setup commands, in order.

Setup steps from the project

OWASP ZAP MCP Server installs with its own commands rather than a config we can generate, so these are copied as-is. Run them in order in a terminal. Source: github.com

  1. 1. Install
    dotnet tool install -g dotnet-zap-mcp
    

Overview

Tools46

What OWASP ZAP MCP Server lets your agent do. Expand a tool for its parameters.

Self-reported~557 tokens of context

Security & health

What it can reach and how reliably it runs β€” from our own checks, not the maintainer’s claims.

ActiveLast checked 2d ago

Recent health check succeeded.

8/8 checks healthy over the last 62d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks β€” not a rating.

GitHub stars4Stargazers on the source repository.
Last commit7mo agoMost recent push to the default branch.
Tools exposed46Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

From the project README

dotnet-zap-mcp

NuGet NuGet Downloads Release

MCP (Model Context Protocol) server for OWASP ZAP. Enables AI agents (Claude, GitHub Copilot, etc.) to drive ZAP vulnerability scanning via MCP.

Features

  • 45 MCP tools for controlling OWASP ZAP (scanning, alerts, spider, ajax spider, context, authentication, reports, etc.)
  • Built-in Docker Compose management (start/stop ZAP with a single tool call)
  • Zero-config setup: auto-generates API keys and extracts Docker assets
  • Works with any MCP-compatible client (Claude Desktop, VS Code, etc.)

Installation

bash
dotnet tool install -g dotnet-zap-mcp

Prerequisites

  • .NET 10 SDK
  • Docker (Docker Engine or Docker Desktop) with docker compose support (for built-in ZAP container management)

Configuration

Zero-config (recommended)

No configuration needed. The agent calls DockerComposeUp which automatically:

  1. Extracts Docker assets to ~/.zap-mcp/docker/
  2. Generates a random API key
  3. Starts the ZAP container on localhost:8090
  4. Waits for ZAP to become healthy

Data persistence

The ZAP container uses two Docker named volumes:

VolumeContainer PathPurpose
zap-home/home/zap/.ZAPZAP settings, contexts, sessions, scan policies (persisted across restarts)
zap-data/zap/wrk/dataShared directory for reports, session files, and context import/export

On the first launch, the template config.xml is copied into zap-home. On subsequent launches, only the API key is updated β€” any changes made through ZAP (contexts, authentication settings, scan policies, etc.) are preserved.

The zap-data volume contains:

  • reports/ β€” generated scan reports
  • sessions/ β€” saved ZAP sessions
  • contexts/ β€” exported context files

Claude Desktop / Claude Code

Add to your MCP configuration:

config.json
{
  "mcpServers": {
    "zap": {
      "command": "zap-mcp"
    }
  }
}

VS Code (Copilot)

Add to .vscode/mcp.json:

config.json
{
  "servers": {
    "zap": {
      "command": "zap-mcp"
    }
  }
}

With existing ZAP instance

If you already have a ZAP instance running, pass connection details via environment variables:

config.json
{
  "mcpServers": {
    "zap": {
      "command": "zap-mcp",
      "env": {
        "ZAP_BASE_URL": "http://localhost:8090",
        "ZAP_API_KEY": "your-api-key"
      }
    }
  }
}

Available Tools

Docker Management

ToolParametersDescription
DockerComposeUpβ€”Start the ZAP container and wait for healthy
DockerComposeDownβ€”Stop and remove the ZAP container
DockerComposeStatusβ€”Check container status
DockerComposeLogstailGet recent container logs

ZAP Core

ToolParametersDescription
GetVersionβ€”Verify ZAP connectivity
GetHostsβ€”List recorded hosts
GetSitesβ€”List recorded sites
GetUrlsbaseUrlList recorded URLs for a base URL

Spider

ToolParametersDescription
StartSpiderurl, maxChildren, recurse, subtreeOnly, contextNameStart a spider scan to crawl and discover pages
GetSpiderStatusscanIdCheck spider progress (0-100%)
GetSpiderResultsscanIdGet URLs discovered by spider
StopSpiderscanIdStop a running spider scan

Active Scan

ToolParametersDescription
StartActiveScanurl, recurse, inScopeOnly, scanPolicyName, contextIdStart an active vulnerability scan
GetActiveScanStatusscanIdCheck active scan progress (0-100%)
StopActiveScanscanIdStop a running active scan

Passive Scan

ToolParametersDescription
GetPassiveScanStatusβ€”Check passive scan progress (records remaining)

Alerts

ToolParametersDescription
GetAlertsSummarybaseUrlAlert counts by risk level
GetAlertsbaseUrl, start, count, riskIdDetailed alert list with pagination and risk filter

Reports

ToolParametersDescription
GetHtmlReportβ€”Generate HTML scan report
GetJsonReportβ€”Generate JSON scan report
GetXmlReportβ€”Generate XML scan report

Context Management

ToolParametersDescription
GetContextListβ€”List all contexts defined in ZAP
GetContextcontextNameGet context details (scope patterns, etc.)
CreateContextcontextNameCreate a new context
RemoveContextcontextNameDelete a context
IncludeInContextcontextName, regexAdd URL include pattern to context scope
ExcludeFromContextcontextName, regexAdd URL exclude pattern to context scope
ImportContextcontextFilePathImport a context file into ZAP
ExportContextcontextName, contextFilePathExport a context to file

Authentication

ToolParametersDescription
GetAuthenticationMethodcontextIdGet the authentication method configured for a context
SetAuthenticationMethodcontextId, authMethodName, authMethodConfigParamsSet authentication method (form-based, JSON-based, script-based, HTTP)
SetLoggedInIndicatorcontextId, loggedInIndicatorRegexSet regex pattern indicating logged-in state
SetLoggedOutIndicatorcontextId, loggedOutIndicatorRegexSet regex pattern indicating logged-out state

Users

ToolParametersDescription
GetUsersListcontextIdList all users for a context
CreateUsercontextId, nameCreate a new user
RemoveUsercontextId, userIdRemove a user
SetAuthenticationCredentialscontextId, userId, authCredentialsConfigParamsSet user credentials (username/password)
SetUserEnabledcontextId, userId, enabledEnable or disable a user

Forced User

ToolParametersDescription
SetForcedUsercontextId, userIdSet the forced user for a context
SetForcedUserModeEnabledenabledEnable or disable forced user mode globally
GetForcedUserStatuscontextIdGet forced user mode status and current forced user

Ajax Spider

ToolParametersDescription
StartAjaxSpiderurl, inScope, contextName, subtreeOnlyStart the Ajax Spider for JavaScript-heavy apps
StartAjaxSpiderAsUsercontextName, userId, url, subtreeOnlyStart the Ajax Spider as a specific user
GetAjaxSpiderStatusβ€”Get Ajax Spider status (running/stopped)
GetAjaxSpiderResultsβ€”Get Ajax Spider results summary
StopAjaxSpiderβ€”Stop the Ajax Spider

Typical Workflow

  1. Agent calls DockerComposeUp to start ZAP
  2. Configure browser/Playwright to use ZAP as proxy (http://127.0.0.1:8090)
  3. Browse the target application through the proxy
  4. Agent calls StartSpider to crawl the application, then GetSpiderStatus to monitor progress
  5. Agent calls GetPassiveScanStatus to wait for passive scan completion
  6. Agent calls StartActiveScan on key pages, then GetActiveScanStatus to monitor progress
  7. Agent calls GetAlertsSummary and GetAlerts to retrieve vulnerability findings
  8. Agent calls GetHtmlReport or GetJsonReport to generate a scan report
  9. Agent calls DockerComposeDown when done

Note: ZAP settings (contexts, authentication, scan policies) are persisted in the zap-home Docker volume. You can stop and restart the container without losing configuration.

Try It Out (with the included vulnerable app)

This repository includes an intentionally vulnerable web application for trying out ZAP scanning. The app contains common vulnerabilities (XSS, SQL Injection, CSRF, Open Redirect) so ZAP can detect real findings.

Setup

bash
# Start ZAP and the vulnerable target app
docker compose -f tests/docker/docker-compose.test.yml up -d --build

# Wait until both containers are healthy
docker compose -f tests/docker/docker-compose.test.yml ps

Then configure your MCP client to connect to this ZAP instance:

config.json
{
  "mcpServers": {
    "zap": {
      "command": "zap-mcp",
      "env": {
        "ZAP_BASE_URL": "http://localhost:8090",
        "ZAP_API_KEY": "test-api-key-for-ci"
      }
    }
  }
}

The vulnerable app is accessible at http://target from within the Docker network (used by ZAP), and at http://localhost:8080 from your host machine.

Example 1: Quick Scan

Prompt to agent:

Scan http://target for vulnerabilities. Run a spider crawl, wait for the passive scan to finish, then show me the alert summary and generate an HTML report.

Expected tool flow:

Code
GetVersion          β†’ Verify ZAP connectivity
StartSpider         β†’ url: "http://target"
GetSpiderStatus     β†’ Poll until 100%
GetPassiveScanStatus β†’ Poll until 0 records remaining
GetAlertsSummary    β†’ baseUrl: "http://target"
GetAlerts           β†’ baseUrl: "http://target"
GetHtmlReport       β†’ Generate report

Reviews

No reviews yet β€” be the first to share how it worked for you.

Frequently Asked Questions about OWASP ZAP MCP Server

OWASP ZAP MCP Server is an MCP server that lets AI agents control OWASP ZAP vulnerability scanning through the Model Context Protocol. It provides 45 MCP tools for scans, alerts, spiders, contexts, authentication, and reports, plus Docker Compose management. It supports MCP clients such as Claude Desktop and VS Code.

Install it globally with `dotnet tool install -g dotnet-zap-mcp`. The prerequisites are the .NET 10 SDK and, for built-in ZAP container management, Docker Engine or Docker Desktop with `docker compose` support.

Yes, the server can manage ZAP with the `DockerComposeUp`, `DockerComposeDown`, `DockerComposeStatus`, and `DockerComposeLogs` tools. `DockerComposeUp` extracts Docker assets, generates an API key, starts ZAP on `localhost:8090`, and waits for it to become healthy.

Set the `ZAP_BASE_URL` and `ZAP_API_KEY` environment variables in the MCP client configuration. For example, use `ZAP_BASE_URL` set to `http://localhost:8090` and provide the API key for the existing ZAP instance.

Related MCP servers

Add a badge to your READMEShow it’s listed β€” live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewOWASP ZAP MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/owasp-zap-mcp-server?style=directory)](https://allmcps.com/mcp/owasp-zap-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/owasp-zap-mcp-server"><img src="https://allmcps.com/api/badge/owasp-zap-mcp-server?style=directory" alt="OWASP ZAP MCP Server on AllMCPs" /></a>