qualys-mcp

v0.6.0
qualys-mcp Checked 1 day ago Published 4 months ago

MCP server for the Qualys VMDR API (read-only) — hosts, vulnerability detections, KnowledgeBase, scans, reports and asset groups

Read-only MCP server for the Qualys VMDR API. Exposes host assets, vulnerability detections, the KnowledgeBase, scans, reports and asset groups to Claude (Claude Desktop / Cowork, Claude Code, or any MCP client). The tool set is deliberately lean, focused on vulnerability reporting across a tag-segmented client base. The raw API tool covers anything else (scans, reports, asset groups, schedules) but is off by default so shared deployments stay strictly read-only. Add to mcpServers in your claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

Summary extracted from the README.

Qualys MCP Server

Read-only MCP server for the Qualys VMDR API. Exposes host assets, vulnerability detections, the KnowledgeBase, scans, reports and asset groups to Claude (Claude Desktop / Cowork, Claude Code, or any MCP client).

Tools

Tool Purpose
qualys_vuln_overview Estate-wide counts by tag: every client's open vulnerabilities by severity in one call, with optional CVSS threshold
qualys_vuln_summary Aggregated vulnerability counts by severity, per client tag and per machine — the dashboard/reporting tool
qualys_list_tags Asset tags and tag hierarchies (how clients are segmented)
qualys_asset_inventory Full CSAM/Global AssetView inventory: all assets with criticality, tags, last logged-on user, agent check-in, sources (filterable by tag, OS, etc.)
qualys_host_detections Vulnerabilities detected per host (QID, severity, status, optional evidence; tag filterable) — the drill-down tool
qualys_knowledgebase QID details: title, CVEs, threat, impact, solution
qualys_api_call Raw GET/POST to any other Qualys endpoint — disabled unless QUALYS_ENABLE_RAW_API=true

The tool set is deliberately lean, focused on vulnerability reporting across a tag-segmented client base. The raw API tool covers anything else (scans, reports, asset groups, schedules) but is off by default so shared deployments stay strictly read-only.

Quick start (Claude Desktop / Cowork)

Add to mcpServers in your claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

"qualys": {
  "command": "npx",
  "args": ["-y", "qualys-mcp"],
  "env": {
    "QUALYS_USERNAME": "your-api-username",
    "QUALYS_PASSWORD": "your-api-password",
    "QUALYS_BASE_URL": "https://qualysapi.qg1.apps.qualys.co.uk"
  }
}

For Claude Code:

claude mcp add-json qualys --scope user '{"type":"stdio","command":"npx","args":["-y","qualys-mcp"],"env":{"QUALYS_USERNAME":"your-api-username","QUALYS_PASSWORD":"your-api-password","QUALYS_BASE_URL":"https://qualysapi.qg1.apps.qualys.co.uk"}}'

Requires Node.js 18+.

Configuration

Three required environment variables:

Variable Value
QUALYS_USERNAME Qualys API user login
QUALYS_PASSWORD Qualys API user password
QUALYS_BASE_URL Your platform's API server (see below)
QUALYS_GATEWAY_URL Optional — the gateway host used by qualys_asset_inventory (CSAM/GAV API). Derived automatically from QUALYS_BASE_URL (e.g. https://gateway.qg1.apps.qualys.co.uk for UK1); only set this if your platform's gateway differs.
QUALYS_ENABLE_RAW_API Optional — set to true to expose qualys_api_call for arbitrary Qualys API endpoints. Leave unset for team deployments.

The API server depends on which Qualys platform your subscription lives on — check your Qualys login URL:

You log in at QUALYS_BASE_URL
qualysguard.qg1.apps.qualys.co.uk (UK1) https://qualysapi.qg1.apps.qualys.co.uk
qualysguard.qualys.eu (EU1) https://qualysapi.qualys.eu
qualysguard.qg2.apps.qualys.eu (EU2) https://qualysapi.qg2.apps.qualys.eu
qualysguard.qualys.com (US1) https://qualysapi.qualys.com
qualysguard.qg2.apps.qualys.com (US2) https://qualysapi.qg2.apps.qualys.com
qualysguard.qg3.apps.qualys.com (US3) https://qualysapi.qg3.apps.qualys.com

Full list: https://www.qualys.com/platform-identification/

Best practice: create a dedicated read-only API user in Qualys (Users → New User, role "Reader" with API access enabled) rather than using your main login. Each team member should use their own API credentials.

Development

git clone <repo>
cd qualys-mcp
npm install
cp .env.example .env   # fill in credentials
npm run dev            # watch mode
npm run inspector      # MCP Inspector UI
npm run build          # compile to dist/

Reporting across a client base

Clients segmented by asset tags? The intended flow for "state of vulnerabilities across our clients" is:

  1. qualys_vuln_overview — one call sweeps the whole estate and returns a client-by-client table: tag, host count, open vulnerabilities by severity. Use exclude_tags to drop system tags (e.g. "Cloud Agent") from the grouping.
  2. qualys_vuln_summary with tags: "Client A" — expand one client into its per-machine breakdown, sorted worst-first. Aggregation happens inside the server, so even thousands of detections come back as a few KB of counts.
  3. qualys_host_detections with tags/ids — drill into the individual findings on a machine, then qualys_knowledgebase for the fix.

CVSS-based thresholds (Cyber Essentials)

Qualys severity (1–5) is not CVSS. If your remediation policy is CVSS-based — e.g. Cyber Essentials' "fix CVSS 7.0+ within 14 days" — pass cvss_min: 7 to qualys_vuln_overview or qualys_vuln_summary. The server joins each detection against the KnowledgeBase CVSS v3 base score (v2 where no v3 exists) and counts only vulnerabilities at or above the threshold. QIDs with no CVSS data are excluded and reported in the response's cvssFilter block. Scores are cached for the server's lifetime, so repeated dashboard queries are fast.

Notes

  • qualys_asset_inventory uses the CSAM/Global AssetView gateway API (JWT auth, JSON) and answers "show me all machines" — including agent-tracked assets, criticality scores and tags. Filter with structured criteria sent in the request body, e.g. filters: [{"field": "tags.name", "value": "Client A"}] — this endpoint does not accept QQL strings. Criteria are ANDed; if a field isn't filterable the API error lists every valid field. Paginate with hasMore/lastSeenAssetId. Note the gateway API has a much stricter rate quota than the VM API — filter rather than sweep repeatedly.
  • For per-machine critical vulnerability counts, combine it with qualys_host_detections using severities="5" (or "4,5").
  • The Qualys VM API returns XML; this server converts it to JSON. VM API calls use the /api/4.0/ paths (the /api/2.0/ paths are end-of-service and EOL in early 2027; v4 output is content-identical).
  • Rate/concurrency limits (HTTP 409/429) are retried automatically using the X-RateLimit-ToWait-Sec header, up to 3 times.
  • Large result sets are truncated by Qualys; the response then contains a WARNING element with the URL for the next page — pass its id_min value back to the same tool to continue.
  • qualys_host_detections output is verbose. Default truncation is 20 hosts per call; filter by severities, status or asset group where possible.