
OWASP ZAP MCP Server
io.github.pierre3由 GitHub 账号 pierre3 发布v1.1.0更新于 Oct 25, 2026
MCP server for OWASP ZAP vulnerability scanning with Docker management
概览
让 AI 助手驱动 OWASP ZAP 漏洞扫描的 MCP 服务器,支持爬虫、主动扫描、告警与报告,并内置 Docker 管理
- 可以做什么
- 通过 Docker Compose 工具启动、停止 ZAP 容器,查看状态和日志,或用 URL 与 API 密钥连接已有 ZAP 实例。使用标准爬虫和 Ajax 爬虫抓取目标,可指定已登录用户,并监控扫描进度。运行主动与被动扫描,并可随时停止。按风险等级分页读取告警,生成 HTML、JSON 或 XML 报告。管理上下文、认证方式、用户、凭据和强制用户模式,以支持认证扫描。
- 适用场景
- 适合让助手对你有权测试的网站执行 Web 安全扫描,从快速被动检查到带报告的认证主动扫描。适合已在使用 OWASP ZAP、希望从聊天客户端驱动扫描流程的开发者和测试人员。
- 运行要求
- 以 .NET 工具在本地运行,需要 .NET 10 SDK。内置 ZAP 容器管理需要支持 docker compose 的 Docker;否则需通过 ZAP_BASE_URL 和 ZAP_API_KEY 环境变量指向已有 ZAP 实例。通过工具启动容器时会自动生成 API 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 OWASP ZAP MCP Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
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
Prerequisites
- .NET 10 SDK
- 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:8090 - Waits for ZAP to become healthy
Data persistence
The ZAP container uses two Docker named volumes:
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:
VS Code (Copilot)
Add to .vscode/mcp.json:
With existing ZAP instance
If you already have a ZAP instance running, pass connection details via environment variables:
Available Tools
Docker Management
ZAP Core
Spider
Active Scan
Passive Scan
Alerts
Reports
Context Management
Authentication
Users
Forced User
Ajax Spider
Typical Workflow
- Agent calls
DockerComposeUpto start ZAP - Configure 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 progress - Agent calls
GetPassiveScanStatusto wait for passive scan completion - Agent calls
StartActiveScanon key pages, thenGetActiveScanStatusto monitor progress - Agent calls
GetAlertsSummaryandGetAlertsto retrieve vulnerability findings - Agent calls
GetHtmlReportorGetJsonReportto generate a scan report - Agent 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
Then configure your MCP client to connect to this ZAP instance:
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:
ZAP 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:
With 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:
The 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
License
来源:README.md,提交 e9c2b67
工具
0版本历史
1- v1.1.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分