Sponsored by Deepsite.site

MCP ZAP Server

Created By
dtkmn8 months ago
A Spring Boot application exposing OWASP ZAP as an MCP (Model Context Protocol) server. It lets any MCP‑compatible AI agent (e.g., Claude Desktop, Cursor) orchestrate ZAP actions—spider, active scan, import OpenAPI specs, and generate reports.
Content

IMPORTANT This project is a work in progress and is not yet production-ready. It is intended for educational purposes and to demonstrate the capabilities of the Model Context Protocol (MCP) with OWASP ZAP.

NOTE This project is not affiliated with or endorsed by OWASP or the OWASP ZAP project. It is an independent implementation of the Model Context Protocol (MCP) for use with OWASP ZAP.

MCP ZAP Server

A Spring Boot application exposing OWASP ZAP as an MCP (Model Context Protocol) server. It lets any MCP‑compatible AI agent (e.g., Claude Desktop, Cursor) orchestrate ZAP actions—spider, active scan, import OpenAPI specs, and generate reports.

Demo on Cursor

▶️ Watch the demo

Table of Contents

Features

  • MCP ZAP server: Exposes ZAP actions as MCP tools. Eliminates manual CLI calls and brittle scripts.
  • OpenAPI integration: Import remote OpenAPI specs into ZAP and kick off active scans
  • Report generation: Generate HTML/JSON reports and fetch contents programmatically
  • Dockerized: Runs ZAP and the MCP server in containers, orchestrated via docker-compose
  • Secure: Configure API keys for both ZAP (ZAP_API_KEY) and the MCP server (MCP_API_KEY)

Architecture

flowchart LR
  subgraph "DOCKER COMPOSE"
    direction LR
    ZAP["OWASP ZAP (container)"]
    MCPZAP["MCP ZAP Server"]
    MCPFile["MCP File System Server"]
    Client["MCP Client (Open Web-UI)"]
    Juice["OWASP Juice-Shop"]
    Petstore["Swagger Petstore Server"]
  end

  MCPZAP <-->|HTTP/SSE + MCPO| Client
  MCPFile <-->|STDIO + MCPO| Client
  MCPZAP -->|ZAP REST API| ZAP
  ZAP -->|scan, alerts, reports| MCPZAP

  ZAP -->|spider/active-scan| Juice
  ZAP -->|Import API/active-scan| Petstore

Prerequisites

  • LLM support Tool calling (e.g. gpt-4o, Claude 3, Llama 3, mistral, phi3)
  • Docker ≥ 20.10
  • Docker Compose ≥ 1.29
  • Java 21+ (only if you want to build the Spring Boot MCP server outside Docker)

Quick Start

git clone https://github.com/dtkmn/mcp-zap-server.git
cd mcp-zap-server
export LOCAL_ZAP_WORKPLACE_FOLDER=$(pwd)/zap-workplace # or any other folder you want to use as ZAP's workspace
docker-compose up -d

Docker-Compose

Open http://localhost:3000 in your browser, and you should see the Open Web-UI interface.

Set Up Custom OpenAI / Ollama API Connection

Admin-Panel-Open-WebUI

Set Up MCP Servers Connection

MCP-Tools-Config-Open-WebUI

Once it is done, you can check the Prompt Examples section to see how to use the MCP ZAP server with your AI agent.

To view logs for all services, run:

   docker-compose logs -f

To view logs for a specific service, run:

   docker-compose logs -f <service_name>

Services Overview

zap

  • Image: zaproxy/zap-stable
  • Purpose: Runs the OWASP ZAP daemon on port 8090.
  • Configuration:
    • Disables the API key.
    • Accepts requests from all addresses.
    • Maps the host directory ${LOCAL_ZAP_WORKPLACE_FOLDER} to the container path /zap/wrk.

open-webui

  • Image: ghcr.io/open-webui/open-webui
  • Purpose: Provides a web interface for managing ZAP and the MCP server.
  • Configuration:
    • Exposes port 3000.
    • Uses a named volume to persist backend data.

mcpo

  • Image: ghcr.io/open-webui/mcpo:main
  • Purpose: Expose any MCP tool as an OpenAPI-compatible HTTP server. Required by open-webui only. https://github.com/open-webui/mcpo
  • Configuration:
    • Runs on port 8000.
    • Connects to the MCP server using SSE via the URL http://mcp-server:7456/sse.

mcp-server

  • Image: mcp-zap-server:latest
  • Purpose: This repo. Acts as the MCP server exposing ZAP actions.
  • Configuration:
    • Depends on the zap service.
    • Exposes port 7456 for HTTP SSE connections.
    • Maps the host directory ${LOCAL_ZAP_WORKPLACE_FOLDER} to /tmp to allow file access.

mcpo-filesystem

  • Image: ghcr.io/open-webui/mcpo:main
  • Purpose: Exposes the MCP File System Server as an OpenAPI-compatible HTTP endpoint.
  • Configuration:
    • Depends on open-webui
    • Exposes port 8001.

juice-shop

  • Image: bkimminich/juice-shop
  • Purpose: Provides a deliberately insecure web application for testing ZAP’s scanning capabilities.
  • Configuration:
    • Runs on port 3001.

petstore

  • Image: swaggerapi/petstore3:unstable
  • Purpose: Runs the Swagger Petstore sample API to demonstrate OpenAPI import and scanning.
  • Configuration:
    • Runs on port 3002.

Stopping the Services

To stop and remove all the containers, run:

docker-compose down

Manual build

./gradlew clean build

Usage with Claude Desktop, Cursor, Windsurf or any MCP‑compatible AI agent

STDIO mode

{
  "mcpServers": {
    "zap-mcp-server": {
        "command": "java",
        "args": [
          "-Dspring.ai.mcp.server.stdio=true",
          "-Dspring.main.web-application-type=none",
          "-Dlogging.pattern.console=",
          "-jar",
          "/PROJECT_PATH/mcp-zap-server/build/libs/mcp-zap-server-0.0.1-SNAPSHOT.jar"
        ]
    }
  }
}

SSE mode

{
  "mcpServers": {
    "zap-mcp-server": {
      "protocol": "mcp",
      "transport": "http",
      "url": "http://localhost:7456/sse"
    }
  }
}

Prompt Examples

Asking for the tools available

mcp-zap-server-prompt-1

Start the spider scan with provided URL

mcp-zap-server-prompt-2

Check the alerts found from the spider scan

mcp-zap-server-prompt-3

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
Playwright McpPlaywright MCP server
ChatWiseThe second fastest AI chatbot™
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Amap Maps高德地图官方 MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Serper MCP ServerA Serper MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Tavily Mcp
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
DeepChatYour AI Partner on Desktop
CursorThe AI Code Editor