Skip to main content
Glama
pierre3

io.github.pierre3/zap-mcp

by pierre3

dotnet-zap-mcp

NuGet NuGet Downloads Release

OWASP ZAP용 MCP(Model Context Protocol) 서버입니다. AI 에이전트(Claude, GitHub Copilot 등)가 MCP를 통해 ZAP 취약점 스캔을 제어할 수 있게 해줍니다.

기능

  • OWASP ZAP을 제어하는 45개의 MCP 도구(스캔, 알림, 스파이더, ajax 스파이더, 컨텍스트, 인증, 보고서 등)

  • 내장된 Docker Compose 관리(단일 도구 호출로 ZAP 시작/중지)

  • 제로 구성 설정: API 키 자동 생성 및 Docker 자산 추출

  • 모든 MCP 호환 클라이언트(Claude Desktop, VS Code 등)와 작동

Related MCP server: Grype MCP Server

설치

dotnet tool install -g dotnet-zap-mcp

사전 요구 사항

  • .NET 10 SDK

  • Docker(Docker Engine 또는 Docker Desktop) 및 docker compose 지원(내장 ZAP 컨테이너 관리용)

구성

제로 구성(권장)

구성이 필요 없습니다. 에이전트가 DockerComposeUp을 호출하면 자동으로:

  1. Docker 자산을 ~/.zap-mcp/docker/에 추출합니다.

  2. 임의의 API 키를 생성합니다.

  3. localhost:8090에서 ZAP 컨테이너를 시작합니다.

  4. ZAP이 정상 상태가 될 때까지 대기합니다.

데이터 영속성

ZAP 컨테이너는 두 개의 Docker 명명된 볼륨을 사용합니다:

볼륨

컨테이너 경로

용도

zap-home

/home/zap/.ZAP

ZAP 설정, 컨텍스트, 세션, 스캔 정책(재시작 후에도 유지)

zap-data

/zap/wrk/data

보고서, 세션 파일, 컨텍스트 가져오기/내보내기용 공유 디렉터리

첫 번째 실행 시 템플릿 config.xmlzap-home에 복사됩니다. 이후 실행에서는 API 키만 업데이트됩니다. ZAP을 통해 변경한 사항(컨텍스트, 인증 설정, 스캔 정책 등)은 보존됩니다.

zap-data 볼륨에는 다음이 포함됩니다:

  • reports/ — 생성된 스캔 보고서

  • sessions/ — 저장된 ZAP 세션

  • contexts/ — 내보낸 컨텍스트 파일

Claude Desktop / Claude Code

MCP 구성에 추가:

{
  "mcpServers": {
    "zap": {
      "command": "zap-mcp"
    }
  }
}

VS Code (Copilot)

.vscode/mcp.json에 추가:

{
  "servers": {
    "zap": {
      "command": "zap-mcp"
    }
  }
}

기존 ZAP 인스턴스 사용

이미 실행 중인 ZAP 인스턴스가 있는 경우 환경 변수를 통해 연결 세부 정보를 전달하세요:

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

사용 가능한 도구

Docker 관리

도구

매개변수

설명

DockerComposeUp

ZAP 컨테이너를 시작하고 정상 상태까지 대기

DockerComposeDown

ZAP 컨테이너를 중지하고 제거

DockerComposeStatus

컨테이너 상태 확인

DockerComposeLogs

tail

최근 컨테이너 로그 가져오기

ZAP 핵심

도구

매개변수

설명

GetVersion

ZAP 연결 확인

GetHosts

기록된 호스트 목록

GetSites

기록된 사이트 목록

GetUrls

baseUrl

기본 URL에 대한 기록된 URL 목록

스파이더

도구

매개변수

설명

StartSpider

url, maxChildren, recurse, subtreeOnly, contextName

페이지를 크롤링하고 발견하기 위한 스파이더 스캔 시작

GetSpiderStatus

scanId

스파이더 진행률 확인(0-100%)

GetSpiderResults

scanId

스파이더가 발견한 URL 가져오기

StopSpider

scanId

실행 중인 스파이더 스캔 중지

능동 스캔

도구

매개변수

설명

StartActiveScan

url, recurse, inScopeOnly, scanPolicyName, contextId

능동 취약점 스캔 시작

GetActiveScanStatus

scanId

능동 스캔 진행률 확인(0-100%)

StopActiveScan

scanId

실행 중인 능동 스캔 중지

수동 스캔

도구

매개변수

설명

GetPassiveScanStatus

수동 스캔 진행률 확인(남은 레코드 수)

알림

도구

매개변수

설명

GetAlertsSummary

baseUrl

위험 수준별 알림 수

GetAlerts

baseUrl, start, count, riskId

페이지네이션 및 위험 필터가 있는 상세 알림 목록

보고서

도구

매개변수

설명

GetHtmlReport

HTML 스캔 보고서 생성

GetJsonReport

JSON 스캔 보고서 생성

GetXmlReport

XML 스캔 보고서 생성

컨텍스트 관리

도구

매개변수

설명

GetContextList

ZAP에 정의된 모든 컨텍스트 나열

GetContext

contextName

컨텍스트 세부 정보 가져오기(범위 패턴 등)

CreateContext

contextName

새 컨텍스트 생성

RemoveContext

contextName

컨텍스트 삭제

IncludeInContext

contextName, regex

컨텍스트 범위에 URL 포함 패턴 추가

ExcludeFromContext

contextName, regex

컨텍스트 범위에서 URL 제외 패턴 추가

ImportContext

contextFilePath

컨텍스트 파일을 ZAP으로 가져오기

ExportContext

contextName, contextFilePath

컨텍스트를 파일로 내보내기

인증

도구

매개변수

설명

GetAuthenticationMethod

contextId

컨텍스트에 구성된 인증 방법 가져오기

SetAuthenticationMethod

contextId, authMethodName, authMethodConfigParams

인증 방법 설정(양식 기반, JSON 기반, 스크립트 기반, HTTP)

SetLoggedInIndicator

contextId, loggedInIndicatorRegex

로그인 상태를 나타내는 정규식 패턴 설정

SetLoggedOutIndicator

contextId, loggedOutIndicatorRegex

로그아웃 상태를 나타내는 정규식 패턴 설정

사용자

도구

매개변수

설명

GetUsersList

contextId

컨텍스트의 모든 사용자 나열

CreateUser

contextId, name

새 사용자 생성

RemoveUser

contextId, userId

사용자 제거

SetAuthenticationCredentials

contextId, userId, authCredentialsConfigParams

사용자 자격 증명 설정(사용자 이름/비밀번호)

SetUserEnabled

contextId, userId, enabled

사용자 활성화 또는 비활성화

강제 사용자

도구

매개변수

설명

SetForcedUser

contextId, userId

컨텍스트에 대한 강제 사용자 설정

SetForcedUserModeEnabled

enabled

강제 사용자 모드를 전역적으로 활성화/비활성화

GetForcedUserStatus

contextId

강제 사용자 모드 상태 및 현재 강제 사용자 가져오기

Ajax 스파이더

도구

매개변수

설명

StartAjaxSpider

url, inScope, contextName, subtreeOnly

JavaScript 중심 앱용 Ajax 스파이더 시작

StartAjaxSpiderAsUser

contextName, userId, url, subtreeOnly

특정 사용자로 Ajax 스파이더 시작

GetAjaxSpiderStatus

Ajax 스파이더 상태 가져오기(실행 중/중지됨)

GetAjaxSpiderResults

Ajax 스파이더 결과 요약 가져오기

StopAjaxSpider

Ajax 스파이더 중지

일반적인 워크플로

  1. 에이전트가 DockerComposeUp을 호출하여 ZAP을 시작합니다.

  2. 브라우저/Playwright를 ZAP 프록시(http://127.0.0.1:8090)로 구성합니다.

  3. 프록시를 통해 대상 애플리케이션을 탐색합니다.

  4. 에이전트가 StartSpider를 호출하여 애플리케이션을 크롤링한 다음 GetSpiderStatus로 진행 상황을 모니터링합니다.

  5. 에이전트가 GetPassiveScanStatus를 호출하여 수동 스캔 완료를 기다립니다.

  6. 에이전트가 주요 페이지에서 StartActiveScan을 호출한 다음 GetActiveScanStatus로 진행 상황을 모니터링합니다.

  7. 에이전트가 GetAlertsSummaryGetAlerts를 호출하여 취약점 결과를 검색합니다.

  8. 에이전트가 GetHtmlReport 또는 GetJsonReport를 호출하여 스캔 보고서를 생성합니다.

  9. 완료되면 에이전트가 DockerComposeDown을 호출합니다.

참고: ZAP 설정(컨텍스트, 인증, 스캔 정책)은 zap-home Docker 볼륨에 유지됩니다. 구성을 잃지 않고 컨테이너를 중지하고 다시 시작할 수 있습니다.

사용해 보기(포함된 취약한 앱 사용)

이 저장소에는 ZAP 스캔을 시험해 볼 수 있도록 의도적으로 취약한 웹 애플리케이션이 포함되어 있습니다. 이 앱에는 일반적인 취약점(XSS, SQL 삽입, CSRF, 오픈 리다이렉트)이 포함되어 있어 ZAP이 실제 결과를 감지할 수 있습니다.

설정

# 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

그런 다음 MCP 클라이언트를 이 ZAP 인스턴스에 연결하도록 구성하세요:

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

취약한 앱은 Docker 네트워크 내부(ZAP에서 사용)에서는 http://target으로, 호스트 머신에서는 http://localhost:8080으로 접근할 수 있습니다.

예제 1: 빠른 스캔

에이전트에게 보내는 프롬프트:

http://target의 취약점을 스캔하세요. 스파이더 크롤링을 실행하고, 패시브 스캔이 끝날 때까지 기다린 다음, 알림 요약을 보여주고 HTML 보고서를 생성하세요.

예상 도구 흐름:

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

ZAP은 /search, /login, /users, /about, /contact 같은 페이지를 발견하고, 패시브 스캔은 누락된 보안 헤더 및 CSRF 취약점과 같은 문제를 보고합니다.

예제 2: 인증된 스캔

/admin 페이지는 로그인이 필요합니다(사용자 이름: admin, 비밀번호: password). 인증된 스캔을 통해 ZAP이 보호된 페이지에 접근할 수 있습니다.

에이전트에게 보내는 프롬프트:

http://target에 대한 인증된 스캔을 설정하세요. 로그인 폼은 /login에 있으며 필드는 "username"과 "password"입니다(자격 증명: admin / password). 로그인 상태 표시는 "Welcome, admin"입니다. 인증을 구성한 후 인증된 사용자로 사이트를 스파이더링하고 액티브 스캔을 실행하세요.

예상 도구 흐름:

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: false

인증이 구성되면 ZAP은 /admin에 접근하여 로그인 뒤의 취약점을 테스트할 수 있습니다.

예제 3: 전체 취약점 평가

에이전트에게 보내는 프롬프트:

http://target에 대한 전체 취약점 평가를 수행하세요. 사이트를 크롤링하고 액티브 스캔을 실행한 다음, 발견된 모든 취약점을 위험 수준별로 그룹화하여 상세히 설명해 주세요.

예상 도구 흐름:

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 report

액티브 스캔은 다음을 포함한 취약점을 감지합니다:

  • 높음: SQL 인젝션 (/users?id=), 크로스 사이트 스크립팅 (/search?q=)

  • 중간: CSRF (/login의 토큰 누락), 오픈 리다이렉트 (/redirect?url=)

  • 낮음/정보: 누락된 보안 헤더, 쿠키 문제 등

정리

docker compose -f tests/docker/docker-compose.test.yml down -v

라이선스

MIT

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    Not graded
    quality
    C
    maintenance
    Integrates 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.
    5
    MIT
  • A
    license
    A
    quality
    F
    maintenance
    Enables AI assistants to perform vulnerability scanning using Grype, supporting scans of directories, container images, and packages via the Model Context Protocol.
    9
    9
    Apache 2.0
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI agents to search, retrieve, and analyze vulnerability data from the NIST National Vulnerability Database through a comprehensive Model Context Protocol server.
    8
    8
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    A lightweight MCP server that wraps OWASP ZAP's REST API as Model Context Protocol tools, enabling AI agents to perform automated security scanning.

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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