Connect an AI agent (MCP)
ZeroQuarry runs an MCP server (Model Context Protocol) so an AI agent can work ZeroQuarry directly: list projects, launch a scan, follow the logs, read findings, and render reports. Claude, Cursor, ChatGPT and Codex, and any MCP client you run yourself can connect to it.
A scan launched over MCP is a real scan. It passes the same tier, quota, and authorization checks as one launched from the console, and it produces the same finding objects the console shows. There is no agent-only path with weaker gates, and nothing an agent returns stays inside the agent: the console shows the scan, its findings, and any verdict the agent records.
Server URL
For ZeroQuarry Cloud, point the client at:
https://mcp.zeroquarry.com/
Self-hosted deployments serve the same protocol at POST /api/v1/mcp on their
own host. A deployment that sets MCP_ROOT_HOST also serves the bare root path
on that host, which is the URL to paste into a client that expects a single
URL with no path.
The console prints the exact URLs for the deployment you are signed in to, on Account > Integrations > MCP server (AI agents).
Authenticate
A client connects one of two ways. Both resolve to the same thing: a ZeroQuarry user, and the agent acts as that user with that user's live permissions.
Through your ZeroQuarry sign-in (OAuth). Add the server URL and the client opens a browser prompt. Sign in with Google or GitHub, approve the connection once, and the client holds a token it refreshes itself. The sign-in is ZeroQuarry's own identity provider, so your ZeroQuarry user stays the account of record. Deactivate the user or change their role and the next request is denied.
Clients find this path on their own. An unauthenticated request comes back as a
401 whose WWW-Authenticate header carries the OAuth discovery metadata URL,
and the server publishes that metadata at
/.well-known/oauth-protected-resource. A client configured with nothing but
a URL finds the whole flow from that 401 alone.
On a deployment with just-in-time signup enabled, the first sign-in creates the ZeroQuarry account. The 401 says so when that applies, so a client does not report a dead end to a user who has never signed in before.
With a personal API key. For scripts and headless agents, mint a key on your Profile page and pass it as a bearer token. The key acts as you, capped by its scopes.
The Profile page offers three scopes, and an agent needs more than one:
| Scope | Grants |
|---|---|
mcp | Opens the MCP server to this key. Without it, the server answers with a 403 naming the missing scope. |
read | Views projects, scans, findings, and reports. |
scans:write | Launches and cancels scans. |
Tick mcp and read for an agent that reports on what it finds. Add
scans:write for an agent that also launches scans.
The three are independent, and the failure modes are worth knowing before you
wire an agent up. A key with only mcp gets past the server's scope check
and then finds that every scan read comes back as not found and every launch
is refused for lack of permission. A key with mcp and read can read
everything and still not launch anything. The scope cap only ever narrows a
key, so a key with all three behaves exactly like the user who minted it.
Connect a client
The mechanics differ slightly per client. The URL is the same.
Claude Code — the browser sign-in is the default path, so no key goes in the config file:
claude mcp add --transport http zeroquarry https://mcp.zeroquarry.com/
Cursor (.cursor/mcp.json) has no browser sign-in, so it needs an API key:
{
"mcpServers": {
"zeroquarry": {
"url": "https://mcp.zeroquarry.com/",
"headers": { "Authorization": "Bearer zq_..." }
}
}
}
ChatGPT and Codex use the same URL as a connector or an MCP server entry. Their browser sign-in flow is the default path.
OpenCode is the same shape: add the server URL as a remote MCP server and let the browser sign-in handle authentication.
Claude Code, ChatGPT, Codex, and OpenCode are all clients that identify themselves by metadata document, so they work without being registered in advance — add the URL and the sign-in prompt appears. The companion CLI registers the server with the clients it can detect (Claude Code, Cursor, Codex, and Claude Desktop); for anything else, adding the URL by hand is the whole procedure.
If your client has no browser sign-in, or you would rather not depend on one,
mint a key on your Profile page with the mcp and read scopes (add
scans:write if the agent should also launch scans) and pass it as a bearer
token. A client that supports the browser sign-in gets a refreshable token
instead, and no long-lived key sits in the configuration file.
What the consent screen says
The first browser sign-in opens a consent screen before anything is granted. It is worth reading, because it is where the connection is identified.
The screen names the client twice, on purpose. The client's name is self-asserted — it is whatever the client says it is called, and the screen labels it that way. Then the screen shows how that name is anchored:
- A client whose identity is a metadata document has a verified hostname. ZeroQuarry fetched the metadata document from that host itself, so the hostname shown is the client's real identity.
- A client that registered anonymously shows the home page it registered under, marked as self-declared. Nothing on ZeroQuarry's side checked that string, so it never claims to be verified.
The screen also shows the requested scope, and it offers exactly two choices: Approve or Deny. Denying is not a dead end — it records the refusal and the client can ask again.
Approving grants the client a token scoped to what the screen listed. The connection is per (user, client): approving in one client does not approve another, and the consent is re-asked if the client's metadata changes.
Consent is tied to your account. Deactivating your user or changing your role narrows what the client can do on its next request.
After you connect
Once the client is connected, the next thing is to make the connection prove
itself. Call list_projects with no arguments — it is a cheap connectivity
check.
A sign-in that just worked on a brand-new account is not proved by an empty
result there: the first sign-in creates the account together with a default
project, so list_projects already returns one item. The reliable signal is
the get_started tool itself. The server advertises it only until the account
has run its first scan, and it returns a tailored plan for this account — what
to ask the user, how to launch and follow the first scan, the tier limits that
apply, and where the depth lives in the skills pack. The plan is composed
server-side from the account's real tier and state.
If you picked the Vibe coder workflow mode, the console's MCP server page walks a human through the same steps: the setup command for each client, what the consent screen asks for, and the sentence to give the agent once it is connected.
The onboarding skill is the depth behind get_started for clients that can
read the pack.
What the agent can do
The tool surface mirrors the console's core loop:
| Tool | What it does |
|---|---|
list_projects, get_project, create_project | Work with projects. |
create_scan | Launch a source, binary, or remote scan. |
get_scan, list_scans, get_scan_logs | Follow status and progress. |
cancel_scan | Stop a queued or running scan. |
check_repo_access | Check that repositories are cloneable before scanning. |
get_findings, get_finding | Read results, with a severity filter. |
record_finding_verdict | Record the human decision on a finding. |
get_poc_artifact | Fetch a finding's proof-of-concept artifact. |
get_report | Render the report as markdown. |
search | Full-text search across the caller's projects, scans, findings, and disclosures. |
get_account | Read the account's tier, entitlements, usage, and trial clock. |
get_dependency_watch | Read known-vulnerable pinned versions across the account or one project. |
list_webhooks, create_webhook, delete_webhook, list_webhook_deliveries | Manage outbound scan delivery. |
list_skills, load_skill | Reach the skills pack from a client without the native skills surface. |
get_started | Get a setup-and-first-scan plan for a new account. |
Three of these are conditional, and an agent should not be surprised by their
absence. list_skills and load_skill are advertised only to clients that did
not declare the MCP Skills extension; a modern client reads the pack natively
instead. get_started is advertised only until the account has run its first
scan. All three stay callable either way, because a client may be holding a
catalog it cached earlier.
Each tool's arguments are documented in MCP tools.
Long scans are durable
A scan can run for a while, longer than a chat turn. create_scan on a client
that supports the MCP Tasks extension returns a durable task: the scan keeps
running on ZeroQuarry's side, the client can poll its status, and a disconnect,
a restart, or a closed laptop loses nothing. The scan's own id is the task id,
so picking the work back up later is just reading the scan.
Permissions
The agent acts as you, and the same rules apply as in the console:
- Scan access is gated on the project's read permission. A scan in a project your user cannot read comes back as not found, and its findings and report come back with it.
- Launching a scan requires the launch permission on the target project, and cancelling requires the cancel permission. The refusal says which.
- A personal API key's power is its owner's current permissions, capped by its scopes and re-checked on every request. Demoting or deactivating the user narrows the agent on its next call.
- Registering a webhook requires the account owner or admin role, because the platform POSTs account data to the URL you register.
Where to go next
- Connect your coding agent is the one-page version of this page, written for an agent that is setting the connection up for you.
- MCP tools is the reference for each tool and its arguments, including the three scan modes.
- The ZeroQuarry skills pack covers the guided workflows the server serves over the MCP Skills extension.
- Scan delivery webhooks covers outbound delivery of scan results to your own systems.
- MCP protocol reference documents the versions, methods, and error codes, for anyone writing a client.
- The zq CLI and device login covers signing in from a terminal and moving credentials to the platform without their values entering agent context.