Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Armur-Ai/Pentest-Swarm-AI/llms.txt
Use this file to discover all available pages before exploring further.
pentestswarm serve starts the Pentest Swarm AI backend — a Fiber HTTP server that exposes a REST API for creating and managing campaigns, querying findings, streaming live events over WebSocket, and listing available models. The server is the backbone of the web dashboard and is also what the pentestswarm campaign subcommands talk to when running in API mode.
Synopsis
Flags
The TCP port the server listens on.
Examples
REST API reference
All endpoints are prefixed with/api/v1. CORS is enabled for all origins (*). Authentication is via X-API-Key header (configured in config.yaml).
GET /api/v1/health
Liveness check. Returns immediately with no database dependency.
Response:
POST /api/v1/campaigns
Create a new campaign. Does not start it — call /campaigns/:id/start to begin execution.
Request body (CreateCampaignRequest):
| Field | Type | Required | Description |
|---|---|---|---|
target | string | ✓ | Domain, IP, or CIDR to test |
scope | []string | ✓ | In-scope domains/CIDRs |
objective | string | Defaults to "find all vulnerabilities" | |
mode | string | manual | bugbounty | asm | ctf. Defaults to "manual" | |
dry_run | bool | Simulate without executing commands |
GET /api/v1/campaigns
List all campaigns.
Response:
GET /api/v1/campaigns/:id
Get detailed state of a single campaign.
Response:
POST /api/v1/campaigns/:id/start
Start executing a planned campaign. Returns 409 Conflict if the campaign is already started.
Response (202 Accepted):
GET /events to follow progress.
POST /api/v1/campaigns/:id/stop
Cancel a running campaign. Sends a context cancellation to all running goroutines and sets status to aborted.
Response:
GET /api/v1/campaigns/:id/findings
Get all findings discovered during a campaign.
Response:
GET /api/v1/campaigns/:id/events
HTTP polling endpoint for campaign events. Returns the last 50 events.
Response:
GET /api/v1/campaigns/:id/ws
WebSocket endpoint for real-time event streaming. Connect with any WebSocket client to receive CampaignEvent JSON objects as they are emitted by the swarm.
Connecting with websocat:
CampaignEvent JSON object:
"ping") from the client to keep the connection warm.
GET /api/v1/models
List the models available in the model registry.
Response:
GET /api/v1/stats
Aggregate statistics across all campaigns — useful for dashboards.
Response:
MCP server (pentestswarm mcp serve)
In addition to the REST API, Pentest Swarm AI exposes a Model Context Protocol (MCP) server over stdio. This lets Claude Desktop, Cursor, and any other MCP-compatible AI client invoke pentestswarm tools natively.
--help by default (it is an advanced integration path). Configure it in Claude Desktop by adding the following to your claude_desktop_config.json:
The MCP server uses stdio transport. It does not open a TCP port. The API key is resolved from config.yaml or environment variables, identical to the CLI.
scan
Launch campaigns via the CLI (uses the embedded server internally)
campaign
Manage campaigns through the TUI — backed by the same REST API
doctor
Verify the API server is reachable with
pentestswarm doctorinit
Configure API keys and generate config.yaml with
pentestswarm init