back to the blog

Panoptic Scans MCP Server vs REST API: When to Use Each for Vulnerability Scanning

Written on . Posted in Informational.

Panoptic Scans MCP Server vs REST API: When to Use Each for Vulnerability Scanning

Panoptic Scans now has a Model Context Protocol (MCP) server. That means your AI agents like Claude Code, Copilot, Hermes, Cursor, and others can create scans, check their progress, pull reports, and walk through findings with you in plain language. You don't have to write any glue code.

Panoptic Scans already has a REST API, so a fair question is why you would want both. This post covers what the MCP server gives you, how it differs from the API, and when each one is the better fit. It also walks through one practical workflow: asking an agent to scan staging after a deploy and tell you what to fix first.

What the Panoptic Scans MCP server is

MCP is an open protocol that lets AI applications discover and call tools exposed by a server. The Panoptic Scans server uses the Streamable HTTP transport at https://panopticscans.com/mcp, and clients can discover it from the public MCP server card.

Once connected, an agent sees three kinds of capabilities:

  • Tools for scans (list_scans, create_scan, update_scan, rerun_scan, delete_scan, list_scan_runs, upload_scan_results), reports (get_report, report_links), vulnerabilities (list_vulnerabilities, get_vulnerability, export_vulnerabilities, accept_vulnerability, mark_false_positive, undo_vulnerability), targets (list_targets, get_target, list_target_vulnerabilities, delete_target), and webhooks (list_webhooks, create_webhook, update_webhook, delete_webhook, test_webhook, list_webhook_deliveries).
  • A prompt called review-findings. It tells the agent to pull your vulnerabilities, group them by host, rank them by severity, and recommend what to fix first, using only the findings the tool returned. It takes an optional severity filter.
  • Resources for the server card and the agent authentication guide, so the agent can read how access works without leaving the session.

A developer at a desk chatting with an AI assistant about vulnerability scans

Same API keys, same tokens, same plan features

The MCP server and the REST API share one authentication system. Both accept the same short-lived bearer access tokens, and every token traces back to an API key you can see and delete under Settings, API Keys. Scripts get a token by exchanging an API key at /api/token. MCP clients that speak OAuth get one when you sign in through the browser, which creates an API key for that client.

Limits are shared too. MCP tool calls count against the same plan limits as REST requests, so a scan from Claude Code uses the same capacity as one from a script. MCP access is included on every plan, so you don't need an upgrade to try it. See pricing for what each plan includes.

How the MCP server differs from the REST API

Both reach the same data. The difference is who is driving and what shape the work takes.

With the REST API, your code decides exactly which endpoint to call, with which parameters, in which order. You get the same behavior on every run and parse the JSON yourself.

With the MCP server, an AI agent picks the tools based on what you asked for, fills in the arguments, reads the results, and explains them. Every tool publishes a description and input schema, so the agent knows that a ZAP scan takes one URL starting with https:// while Nmap, OpenVAS, and Nuclei take hostnames or IPs. You don't have to remember any of that.

  REST API MCP server
Who drives Your code An AI agent, guided by you
Endpoint https://panopticscans.com/api https://panopticscans.com/mcp (Streamable HTTP)
Discovery OpenAPI spec and the API portal Server card plus tools/list and prompts/list at runtime
Authentication API key exchanged for a bearer access token and refresh token at /api/token Browser sign-in (OAuth with PKCE) in clients like Cursor, or the same bearer token; plus an Mcp-Session-Id header after initialize
Plan limits Your plan's limits The same limits
Output JSON you parse Results the agent reads and summarizes for you
Repeatability Same input, same calls, every time Depends on the model and the prompt
Best at CI/CD, scheduled jobs, integrations, webhook receivers Interactive triage, ad-hoc questions, agents in your IDE

Advantages of using the MCP server

No glue code for one-off questions. "Which hosts have unresolved High findings?" is a small script against the API. In Cursor it's one sentence, and the agent calls list_vulnerabilities with severity set to High and status set to Unresolved.

Triage happens where you fix things. Your agent can read a finding with get_vulnerability, including the evidence, affected port, CVSS data, and suggested solution, then open the file in your repo that needs the change.

Plain-language summaries. The review-findings prompt gives you a ranked, host-by-host summary without sorting a CSV by hand. It pairs well with our post on vulnerability prioritization for SaaS.

Featured workflow: scan staging after a deploy and summarize what to fix first

You have just shipped to staging. Before you promote to production, you want a quick scan and a short list of anything worth fixing. In Cursor's agent chat, ask for it directly:

I just deployed to staging. Run a one-time ZAP scan against
https://staging.example.com, email the results to my email,
and use the Eastern time zone. Check on it until it's done,
then use the review-findings prompt to summarize the findings for the
staging host and tell me what to fix first. Don't accept, delete, or
mark anything as a false positive without asking me.

Here is roughly what the agent does with that request:

  • It calls create_scan with scan_type set to ZAP, scan_frequency set to One-time, your staging URL as scan_target, plus the time zone and email.
  • It checks progress with list_scans and reads scan_progress, which distinguishes Running and Done from Failed, Timeout, and Target Unreachable, so you hear clearly if staging was down.
  • When the scan is done, it follows the review-findings instructions and calls list_vulnerabilities. Because the prompt looks at your whole account, ask the agent to narrow it with the target filter so you only see staging.
  • For the top items, it calls get_vulnerability to read the evidence and solution. For the full write-up, it can fetch the report with get_report.

You get back a short ranked list of what was found, where, why it matters, and what to change, grounded in findings the tool actually returned. Web app scans can take a while, so you can also ask for the summary later.

If staging exposes a public API, see our guide on API vulnerability scanning for indie SaaS. For scans behind a login, see authenticated scanning, which create_scan supports through a Selenium login script.

A rocket launching from a staging platform while a radar beam sweeps across servers

Connecting Panoptic Scans to Cursor

Cursor supports remote MCP servers over Streamable HTTP, including servers that sign you in with OAuth. It reads configuration from .cursor/mcp.json in a project or ~/.cursor/mcp.json for all projects. Per the Cursor MCP documentation, a remote server only needs a url. For Panoptic Scans, that is the whole config:

{
  "mcpServers": {
    "panoptic-scans": {
      "url": "https://panopticscans.com/mcp"
    }
  }
}

No API key or token goes in the file. When Cursor connects, the server tells it where to sign in, and the rest happens in your browser:

  • Cursor registers itself with Panoptic Scans at /oauth/register, then opens /oauth/authorize in your browser.
  • You sign in to Panoptic Scans, with email and password or Google, and click Allow.
  • Cursor exchanges the authorization code for an access token and a refresh token, using PKCE so an intercepted code is useless. It stores the refresh token and renews the access token on its own when it expires.

Allowing access creates an API key for Cursor, with a name like cursor-a1b2c3d4, under Settings, API Keys. To disconnect Cursor, delete that key. Its refresh token stops working right away, access tokens already issued expire on schedule, and your other integrations keep working.

Tokens for scripts and other clients

Not every client speaks OAuth, and a CI job has no browser. Those can use the API key flow, and the tokens work for both the REST API and the MCP server:

curl -X POST "https://panopticscans.com/api/token?key=YOUR_API_KEY"

The JSON response includes access_token, refresh_token, token_type (bearer), and expires_in in seconds. Access tokens last 3600 seconds, or one hour. Send Authorization: Bearer YOUR_ACCESS_TOKEN on each request.

When an access token expires, the API and the MCP server both answer with 401 and a WWW-Authenticate header containing error="invalid_token". That is your cue to trade the refresh token for a new pair at the same endpoint:

curl -X POST https://panopticscans.com/api/token \
  -d grant_type=refresh_token \
  -d refresh_token=YOUR_REFRESH_TOKEN

A few rules from the auth guide are worth knowing:

  • Each refresh returns a new access token and a new refresh token. Throw away the one you just used.
  • A refresh token works once. If a used one shows up again, it is rejected, and the refresh tokens issued after it stop working too. That limits the damage from a leak, but two processes sharing one refresh token will lock each other out, so give each integration its own API key.
  • If the 401 says error="insufficient_scope" instead, the token is valid and refreshing it will not help.
  • Send the API key and refresh token only to /api/token, never with normal API or MCP calls.
  • The older /api/refresh endpoint is legacy and only works while the current access token is still valid. Use the refresh token grant instead.

When to use the REST API

Use the API when the work has to be repeatable, auditable, or unattended:

  • CI/CD pipelines. Start a scan after every deploy with a fixed set of parameters and fail the build on new High findings. You don't want a language model deciding whether to run that step.
  • Deterministic scripts and scheduled jobs. Nightly exports, audit evidence, syncing findings into a ticket tracker. Our SOC 2 vulnerability scanning guide explains why consistent evidence matters.
  • Webhooks. Panoptic Scans can call your HTTPS endpoint, Slack, Discord, or Microsoft Teams on scan.completed and scan.failed, with HMAC-SHA256 signatures. Event-driven automation belongs in code that verifies those signatures. See webhooks.
  • Integrations. Anything that ships in your product or in MSP client tooling should call documented endpoints from the OpenAPI spec.

When to use the MCP server

  • Interactive triage. Walking through findings, asking follow-up questions, and fixing code in the same session.
  • Ad-hoc questions. "Which targets haven't been scanned in a month?" or "Export the Medium findings for this host as CSV."
  • Agents in your IDE. Letting Claude Code or Cursor scan staging when you finish a feature and summarize results before you open a pull request.

Many teams will use both: the pipeline runs scans through the API, and people use MCP to make sense of the results.

Potential tradeoffs

Language models are not deterministic. The same request can lead to different tool calls or summaries. That is fine for exploring, and wrong for anything that must behave identically every time. Put those steps in code.

Keep a human in the loop for destructive actions. Every Panoptic Scans tool carries MCP safety hints. Read-only tools such as list_scans, list_vulnerabilities, and get_report set readOnlyHint. The tools that delete data or change a vulnerability's status set destructiveHint: delete_scan, delete_target (which also removes that target's recorded vulnerabilities), delete_webhook, accept_vulnerability, mark_false_positive, and undo_vulnerability. Hints help clients decide what deserves a closer look, but they are not a guarantee. Cursor asks for approval before running MCP tools by default. Leave that on and read the arguments before you approve, especially for anything marked destructive. Accepting a risk or marking a false positive should always be a conscious security decision.

Scans cost capacity. create_scan spends plan capacity no matter who calls it, so be specific about targets and frequency.

Treat keys and tokens like passwords. An access token covers your account's full API and MCP access, not a subset of scopes. Keep API keys and refresh tokens in a secret store, never in code, and give each integration its own key. Cursor sign-in already gets its own, so you can revoke it without breaking your pipeline.

Getting started

Add the one-line config above to Cursor, sign in when the browser opens, and try the staging workflow on your next deploy. For scripts and CI, create a dedicated API key instead. The Developer API and MCP docs cover the details, and the API portal has the interactive reference. New to Panoptic Scans? Start with the getting started guide.