MCP Tools

The following tools are available for MCP clients to invoke:

zap_version

Get the ZAP version.

zap_info

Get basic ZAP information.

zap_create_context

Create a ZAP context with the given name, URL and optional include/exclude regexes.

Parameters: name, url, and optionally include_regexes, exclude_regexes

zap_start_spider

Start the spider. The target can be a URL (creates a temporary context) or the name of an existing context. Returns a scan_id for use with zap_stop_spider and zap_get_spider_status.

Parameters: target - a URL or context name

zap_stop_spider

Stop the spider plan if it is running.

Parameters: scan_id - the ID returned by zap_start_spider

zap_get_spider_status

Get the status of the spider plan.

Parameters: scan_id - the ID returned by zap_start_spider

zap_start_ajax_spider

Start the AJAX spider. The target can be a URL (creates a temporary context) or the name of an existing context. Returns a scan_id for use with zap_stop_ajax_spider and zap_get_ajax_spider_status.

Parameters: target - a URL or context name

zap_stop_ajax_spider

Stop the AJAX spider plan if it is running.

Parameters: scan_id - the ID returned by zap_start_ajax_spider

zap_get_ajax_spider_status

Get the status of the AJAX spider plan.

Parameters: scan_id - the ID returned by zap_start_ajax_spider

zap_start_active_scan

Start the active scan. The target can be a URL (creates a temporary context) or the name of an existing context. Optionally specify a scan policy. The target URL should be in the sites tree (spider first). Returns a scan_id for use with zap_stop_active_scan and zap_get_active_scan_status.

Parameters: target - a URL or context name, optionally policy - scan policy name (see zap://scan-policies)

zap_stop_active_scan

Stop the active scan plan if it is running.

Parameters: scan_id - the ID returned by zap_start_active_scan

zap_get_active_scan_status

Get the status of the active scan plan.

Parameters: scan_id - the ID returned by zap_start_active_scan

zap_get_passive_scan_status

Get the passive scan queue status. Returns the number of HTTP records waiting to be passively scanned. When the count reaches zero all collected traffic has been analysed. Requires the pscan add-on.

No parameters.

zap_get_history

Get selected parts of a ZAP history entry. Prefer this over zap://history/{id} when response or request bodies may be large.

Parameters:

  • id - history entry ID (e.g. 123)
  • fields - optional list of requestHeader, requestBody, responseHeader, responseBody (defaults to both headers)
  • body_offset - optional start index into each included body (0-based; negative values count from the end)
  • max_body_chars - optional maximum characters per included body (default 4000)

When a body field is included the result also provides *Length, *Offset, *Returned, and *Truncated metadata (e.g. responseBodyTruncated, requestBodyTruncated).

zap_generate_report

Generate a ZAP report. Use the zap://report-templates resource to discover available template names. Requires the reports add-on.

Parameters: file_path - full path for the output file (e.g. /tmp/report.html), template - template config name (e.g. traditional-html), optionally title - report title

zap_list_resources

List available ZAP MCP resources (URI, name, description). Useful for clients that only support tools; clients that support the resources capability can use resources/list instead.

No parameters. Use zap_read_resource to read a listed resource.

zap_read_resource

Read a ZAP MCP resource by URI. Use zap_list_resources to discover available URIs (including templates such as zap://history/{id}). Clients that support the resources capability can use resources/read instead.

Parameters: uri - the resource URI (e.g. zap://alerts or zap://history/123)

See Also