zap
MCP server from LisBerndt/zap-mcp-server
claude mcp add --transport stdio lisberndt-zap-mcp-server python -m zap_custom_mcp \ --env ZAP_BASE="http://127.0.0.1:8080" \ --env ZAP_MCP_HOST="127.0.0.1" \ --env ZAP_MCP_PORT="8082" \ --env ZAP_AUTOSTART="true" \ --env ZAP_LOG_LEVEL="INFO"
How to use
This MCP server integrates OWASP ZAP with MCP clients and AI assistants to enable automated security testing from your development workflow. It launches ZAP, loads or creates a session, and exposes an MCP endpoint at http://localhost:8082/mcp for clients to connect and issue security scan commands such as Active, Passive, AJAX Spider, and Complete scans. The server also handles automatic URL transformation when running inside container environments, mapping localhost URLs to the appropriate host gateway so your tests target the correct service. You can pair MCP-compatible AI assistants to interpret scan results, annotate findings, and suggest remediation steps, enabling AI-assisted security analysis during development.
To use the server, start it and point your MCP clients at the provided MCP URL. The client can request scans, fetch reports, and review vulnerability details. The configuration supports tuning ZAP and MCP behavior via environment variables, such as enabling autostart of ZAP, setting the MCP port, and adjusting the logging level for debugging. The included Docker/Podman deployment path simplifies containerized usage, while the local Python execution path is ideal for development and testing on a workstation.
How to install
Prerequisites:
- Python 3.8+ installed and available on PATH
- OWASP ZAP installed and accessible via PATH (zap.sh or zap.bat)
- Java runtime (OpenJDK 11+ recommended)
- (Optional) Docker or Podman for containerized deployment
Option A: Local installation (Python package)
-
Clone the repository git clone https://github.com/LisBerndt/zap-custom-mcp.git cd zap-custom-mcp
-
Install Python dependencies pip install -r requirements.txt
-
Ensure ZAP is installed and accessible via PATH
- Verify: zap.sh on Linux/macOS or zap.bat on Windows
-
Run the MCP server locally python -m zap_custom_mcp
Option B: Docker/Podman deployment
-
Clone the repository and navigate to it git clone https://github.com/LisBerndt/zap-custom-mcp.git cd zap-custom-mcp
-
Build and start containers (auto-detects Docker/Podman) ./build.sh ./start.sh
Windows users can use the provided batch files: build.bat and start.bat
-
Access the MCP endpoint at http://localhost:8082/mcp
Prerequisites for container deployments are documented in DOCKER.md and PODMAN.md within the repository.
Additional notes
Tips and common issues:
- Ensure ZAP_BASE points to the correct ZAP API endpoint. If ZAP runs inside a container, adjust the base URL accordingly.
- The MCP port (ZAP_MCP_PORT) must be exposed and not blocked by firewalls.
- The server will auto-start ZAP if it is not already running; this can take around a minute to initialize fully.
- When running in containers, automatic URL transformation will map localhost URLs to the appropriate host gateway (host.docker.internal or host.containers.internal). If you encounter connection issues, verify that the host gateway mapping is correct for your environment.
- If you need more verbose logs for debugging, set ZAP_LOG_LEVEL to DEBUG.
- The recommended local command for reliability is python -m zap_custom_mcp.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP