io.github.pierre3/zap-mcp
Integrates with the OWASP ZAP vulnerability scanner, allowing AI agents to drive scanning and management of the OWASP ZAP tool.
Provides tools to control OWASP ZAP, including spider crawling, active/passive scanning, alert retrieval, report generation, context management, authentication configuration, and user management for vulnerability scanning.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@io.github.pierre3/zap-mcpScan https://example.com for vulnerabilities and show summary"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dotnet-zap-mcp
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.)
Related MCP server: Grype MCP Server
Installation
dotnet tool install -g dotnet-zap-mcpPrerequisites
Docker (Docker Engine or Docker Desktop) with
docker composesupport (for built-in ZAP container management)
Configuration
Zero-config (recommended)
No configuration needed. The agent calls DockerComposeUp which automatically:
Extracts Docker assets to
~/.zap-mcp/docker/Generates a random API key
Starts the ZAP container on
localhost:8090Waits for ZAP to become healthy
Data persistence
The ZAP container uses two Docker named volumes:
Volume | Container Path | Purpose |
|
| ZAP settings, contexts, sessions, scan policies (persisted across restarts) |
|
| Shared 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 reportssessions/— saved ZAP sessionscontexts/— exported context files
Claude Desktop / Claude Code
Add to your MCP configuration:
{
"mcpServers": {
"zap": {
"command": "zap-mcp"
}
}
}VS Code (Copilot)
Add to .vscode/mcp.json:
{
"servers": {
"zap": {
"command": "zap-mcp"
}
}
}With existing ZAP instance
If you already have a ZAP instance running, pass connection details via environment variables:
{
"mcpServers": {
"zap": {
"command": "zap-mcp",
"env": {
"ZAP_BASE_URL": "http://localhost:8090",
"ZAP_API_KEY": "your-api-key"
}
}
}
}Available Tools
Docker Management
Tool | Parameters | Description |
| — | Start the ZAP container and wait for healthy |
| — | Stop and remove the ZAP container |
| — | Check container status |
|
| Get recent container logs |
ZAP Core
Tool | Parameters | Description |
| — | Verify ZAP connectivity |
| — | List recorded hosts |
| — | List recorded sites |
|
| List recorded URLs for a base URL |
Spider
Tool | Parameters | Description |
|
| Start a spider scan to crawl and discover pages |
|
| Check spider progress (0-100%) |
|
| Get URLs discovered by spider |
|
| Stop a running spider scan |
Active Scan
Tool | Parameters | Description |
|
| Start an active vulnerability scan |
|
| Check active scan progress (0-100%) |
|
| Stop a running active scan |
Passive Scan
Tool | Parameters | Description |
| — | Check passive scan progress (records remaining) |
Alerts
Tool | Parameters | Description |
|
| Alert counts by risk level |
|
| Detailed alert list with pagination and risk filter |
Reports
Tool | Parameters | Description |
| — | Generate HTML scan report |
| — | Generate JSON scan report |
| — | Generate XML scan report |
Context Management
Tool | Parameters | Description |
| — | List all contexts defined in ZAP |
|
| Get context details (scope patterns, etc.) |
|
| Create a new context |
|
| Delete a context |
|
| Add URL include pattern to context scope |
|
| Add URL exclude pattern to context scope |
|
| Import a context file into ZAP |
|
| Export a context to file |
Authentication
Tool | Parameters | Description |
|
| Get the authentication method configured for a context |
|
| Set authentication method (form-based, JSON-based, script-based, HTTP) |
|
| Set regex pattern indicating logged-in state |
|
| Set regex pattern indicating logged-out state |
Users
Tool | Parameters | Description |
|
| List all users for a context |
|
| Create a new user |
|
| Remove a user |
|
| Set user credentials (username/password) |
|
| Enable or disable a user |
Forced User
Tool | Parameters | Description |
|
| Set the forced user for a context |
|
| Enable or disable forced user mode globally |
|
| Get forced user mode status and current forced user |
Ajax Spider
Tool | Parameters | Description |
|
| Start the Ajax Spider for JavaScript-heavy apps |
|
| Start the Ajax Spider as a specific user |
| — | Get Ajax Spider status (running/stopped) |
| — | Get Ajax Spider results summary |
| — | Stop the Ajax Spider |
Typical Workflow
Agent calls
DockerComposeUpto start ZAPConfigure browser/Playwright to use ZAP as proxy (
http://127.0.0.1:8090)Browse the target application through the proxy
Agent calls
StartSpiderto crawl the application, thenGetSpiderStatusto monitor progressAgent calls
GetPassiveScanStatusto wait for passive scan completionAgent calls
StartActiveScanon key pages, thenGetActiveScanStatusto monitor progressAgent calls
GetAlertsSummaryandGetAlertsto retrieve vulnerability findingsAgent calls
GetHtmlReportorGetJsonReportto generate a scan reportAgent calls
DockerComposeDownwhen done
Note: ZAP settings (contexts, authentication, scan policies) are persisted in the
zap-homeDocker 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
# 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 psThen configure your MCP client to connect to this ZAP instance:
{
"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://targetfrom within the Docker network (used by ZAP), and athttp://localhost:8080from 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:
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 reportZAP will discover pages like /search, /login, /users, /about, /contact, and the passive scan will report issues such as missing security headers and CSRF vulnerabilities.
Example 2: Authenticated Scan
The /admin page requires login (username: admin, password: password). An authenticated scan lets ZAP access protected pages.
Prompt to agent:
Set up an authenticated scan for http://target. The login form is at /login with fields "username" and "password" (credentials: admin / password). The logged-in indicator is "Welcome, admin". After configuring authentication, spider the site as the authenticated user and run an active scan.
Expected tool flow:
CreateContext → contextName: "target-auth"
IncludeInContext → regex: "http://target.*"
SetAuthenticationMethod → contextId, authMethodName: "formBasedAuthentication",
authMethodConfigParams: "loginUrl=http://target/login&loginRequestData=username%3D%7B%25username%25%7D%26password%3D%7B%25password%25%7D"
SetLoggedInIndicator → loggedInIndicatorRegex: "Welcome, admin"
CreateUser → contextId, name: "admin"
SetAuthenticationCredentials → contextId, userId, authCredentialsConfigParams: "username=admin&password=password"
SetUserEnabled → contextId, userId, enabled: true
SetForcedUser → contextId, userId
SetForcedUserModeEnabled → enabled: true
StartSpider → url: "http://target", contextName: "target-auth"
GetSpiderStatus → Poll until 100%
GetPassiveScanStatus → Poll until 0 records remaining
StartActiveScan → url: "http://target"
GetActiveScanStatus → Poll until 100%
GetAlertsSummary → baseUrl: "http://target"
GetAlerts → baseUrl: "http://target"
SetForcedUserModeEnabled → enabled: falseWith authentication configured, ZAP can access /admin and test for vulnerabilities behind the login.
Example 3: Full Vulnerability Assessment
Prompt to agent:
Perform a full vulnerability assessment of http://target. Crawl the site, run an active scan, then give me a detailed breakdown of all discovered vulnerabilities grouped by risk level.
Expected tool flow:
StartSpider → url: "http://target", recurse: true
GetSpiderStatus → Poll until 100%
GetSpiderResults → Review discovered URLs
GetPassiveScanStatus → Poll until 0 records remaining
StartActiveScan → url: "http://target", recurse: true
GetActiveScanStatus → Poll until 100%
GetAlertsSummary → baseUrl: "http://target"
GetAlerts → baseUrl: "http://target", riskId: "3" (High)
GetAlerts → baseUrl: "http://target", riskId: "2" (Medium)
GetAlerts → baseUrl: "http://target", riskId: "1" (Low)
GetHtmlReport → Generate final reportThe active scan will detect vulnerabilities including:
High: SQL Injection (
/users?id=), Cross Site Scripting (/search?q=)Medium: CSRF (missing tokens on
/login), Open Redirect (/redirect?url=)Low/Informational: Missing security headers, cookie issues, etc.
Cleanup
docker compose -f tests/docker/docker-compose.test.yml down -vLicense
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceIntegrates 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.5MIT

Grype MCP Serverofficial
AlicenseAqualityFmaintenanceEnables AI assistants to perform vulnerability scanning using Grype, supporting scans of directories, container images, and packages via the Model Context Protocol.99Apache 2.0- AlicenseAqualityDmaintenanceEnables AI agents to search, retrieve, and analyze vulnerability data from the NIST National Vulnerability Database through a comprehensive Model Context Protocol server.88MIT
- FlicenseNot gradedqualityCmaintenanceA lightweight MCP server that wraps OWASP ZAP's REST API as Model Context Protocol tools, enabling AI agents to perform automated security scanning.
Related MCP Connectors
CVE lookups (NVD) and dependency-manifest audits (OSV) for AI agents. No API keys.
CVE lookups (NVD) and dependency-manifest audits (OSV) for AI agents. No API keys.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pierre3/dotnet-zap-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server