Skip to main content
Glama
qualys-pci-mcp

qualys-pci-mcp

by RobotDisco

qualys-pci-mcp

A read-only MCP server for the Qualys PCI Merchant API. It lets an LLM assistant answer questions about your PCI compliance posture, so that weekly compliance chores stop being a manual trawl through the Qualys console.

Description

This project exposes the PCI Merchant API's read endpoints as MCP tools, so you can ask questions in plain language instead:

  • "Which hosts are failing PCI right now?"

  • "List the confirmed-high findings that aren't already accepted false positives."

Related MCP server: Qualys MCP Server

AI Disclosure

This project is very much vibe-coded in anger, to solve particular needs. As always, inspect the source code.

Requirements

  • Python 3.11+

  • uv

  • A Qualys PCI merchant account with API access

Installation

Not published to PyPI yet, so install from a clone:

git clone https://github.com/RobotDisco/qualys-pci-mcp && cd qualys-pci-mcp
uv tool install .

Or run it straight from the checkout without installing:

uv sync && uv run qualys-pci-mcp

Then register it with your MCP client. For Claude Desktop on MacOS, place it in ~/Library/Application Support/Claude/claude_desktop_config.json.

{
  "mcpServers": {
    "qualys-pci": {
      "command": "/Users/you/.local/bin/qualys-pci-mcp",
      "env": {
        "QUALYS_PCI_USERNAME": "your-pci-username",
        "QUALYS_PCI_PASSWORD": "your-pci-password"
      }
    }
  }
}

Configuration

Variable

Required

Default

QUALYS_PCI_USERNAME

yes

—

QUALYS_PCI_PASSWORD

yes

—

QUALYS_PCI_BASE_URL

no

https://pci-api.qualys.com

QUALYS_PCI_DOWNLOAD_DIR

no

~/.local/share/qualys-pci-mcp/downloads — where scan-report PDFs are saved

Missing or partial credentials fail at startup, not mid-request — so you find out when you launch, not halfway through a compliance report.

Usage

As an MCP server

Once registered, ask your assistant directly:

Which hosts are currently failing PCI?

Tools

Tool

What it returns

pci_list_assets

Declared in-scope IPs, DNS hostnames, and virtual hosts

pci_compliance_summary

Per-host PCI Pass/Fail — the main way to iterate hostnames

pci_list_vulns

Vulnerability detections, compact rows

pci_get_vuln

One detection in full

pci_list_scans / pci_get_scan

Scan history and per-scan metadata

pci_download_scan_report

Saves a scan's PDF report; returns the path. Usually 404s — reports must be generated in the Qualys console first, and generation is a write operation this server does not perform

Support

Open an issue on the repository. When reporting an API problem, please include the endpoint, the parameters you used, and the HTTP status — never your credentials, and note that Qualys error bodies can echo request parameters.

Contributing

Contributions welcome. Before opening a PR:

  • Read CLAUDE.md. Its invariants are not style preferences — two of them (never retry a 401, never write to stdout) prevent a locked audit account and a silently corrupted MCP stream respectively.

  • Read the relevant ADR. If your change contradicts one, that's fine, but it needs a superseding ADR rather than an edit to the existing one.

  • just check must pass — lint, formatting, mypy --strict, and tests. CI runs the same recipe. just recipes are listed with just; see the justfile if you would rather run the underlying commands directly.

  • Never add an endpoint path that hasn't been verified against live documentation. Guessed paths are the single most likely source of confidently-broken code in this codebase. docs/reference/pci-api.md records which paths are verified, which are documentation-only, and which documented details turned out to be wrong.

Acknowledgements

The API reference was reconstructed from Qualys's published documentation at docs.qualys.com/en/pci/api/. Qualys is a trademark of Qualys, Inc.; this project is unaffiliated.

License

Apache-2.0.

Chosen over MIT for its explicit patent grant and contributor terms, which matter for a tool that wraps a commercial vendor's API, and over GPLv3 because MCP's process boundary means copyleft could not reach the integrations it would most plausibly be intended to govern.

Available Tools

7 tools
pci_compliance_summaryA
Read-only

Per-host PCI Pass/Fail status. The primary way to iterate hostnames.

Args: offset: 1-based record offset. 0 is invalid. limit: Rows per page, 1-1000. dns: Filter to a single hostname. compliance_status: Filter by "Pass" or "Fail". fetch_all: Walk every page rather than returning one.

There is deliberately no ip filter: Qualys ignores the documented spelling and no working one has been confirmed, so an ip argument would appear to narrow the results while returning every row.

Returns total_count so growth in scope is always visible.

Inputs: dns, limit, offset, fetch_all, +1 more. Returns: object

pci_download_scan_reportA
Read-only

Download a scan's report PDF and return the path it was saved to.

Args: scan_id: The scan's scan_id from pci_list_scans.

PDF is the only format Qualys offers here. The bytes are written to disk and only a path is returned -- a PDF is not usable as tool output.

A 404 is the normal case, not a failure. Reports must be generated in the Qualys console first, and generation is a write operation this server does not perform. A 404 means only "no report has been generated for this scan yet". It does not mean the scan is missing, and it is not a compliance finding -- do not report it as one.

Inputs: scan_id (required). Returns: object

pci_get_scanA
Read-only

Detail for one scan.

Args: scan_id: The scan's scan_id from pci_list_scans.

active_hosts is an aggregate count. The API exposes no per-host alive/dead breakdown, so none is reported.

Inputs: scan_id (required). Returns: object

pci_get_vulnA
Read-only

Full detail for one vulnerability finding, including prose fields.

Args: detection_id: The finding's id from pci_list_vulns -- not its qid.

Inputs: detection_id (required). Returns: object

pci_list_assetsA
Read-only

List declared in-scope PCI assets.

Args: asset_type: ALL, IP, DNS, or VIRTUALHOST.

This is declared scope -- configuration, not observation. It says nothing about whether a host responded to a scan.

Inputs: asset_type. Returns: object

pci_list_scansA
Read-only

List PCI scans, newest first.

Args: offset: 1-based record offset. limit: Rows per page, 1-1000.

Inputs: limit, offset. Returns: object

pci_list_vulnsA
Read-only

List vulnerability findings as compact rows.

Args: offset: 1-based record offset. limit: Rows per page, 1-1000. ip: Filter by IP, CIDR, or range. dns: Filter by hostname. qid: Filter by Qualys ID. title: Keyword search on the finding title. severity: Any of CONFIRMED_HIGH, CONFIRMED_MED, CONFIRMED_LOW, POTENTIAL_HIGH, POTENTIAL_MED, POTENTIAL_LOW. false_positive: Any of Requested, Rejected, Expired. pci_fail_vulns: True to return only findings that fail PCI. fetch_all: Walk every page rather than returning one.

Prose fields are deliberately absent; call pci_get_vuln for one finding's threat, impact, and solution text.

Inputs: ip, dns, qid, limit, +6 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action: assets, compliance summary, vulnerabilities (list/detail), scans (list/detail), and report download. No two tools overlap in purpose, and the descriptions clarify any potential confusion between list and get variants.

    Naming Consistency5/5

    All tools follow a consistent 'pci_<verb>_<noun>' pattern with clear verbs: list, get, download. Plural nouns for list operations and singular for get operations are conventional and predictable.

    Tool Count5/5

    Seven tools is well within the typical 3-15 range and each tool addresses a necessary aspect of the PCI compliance workflow: asset scope, compliance status, vulnerability findings, scan management, and report retrieval. No tool feels redundant or missing.

    Completeness4/5

    The tool set covers the primary read-only workflows for Qualys PCI compliance: listing assets, viewing compliance status, enumerating and detailing vulnerabilities, listing and detailing scans, and downloading scan reports. Minor gaps exist, such as no ability to initiate scans or generate reports in Qualys, but the server explicitly notes these are write operations outside its scope.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A remote MCP server that exposes mock application security testing data (applications, scans, issues) for LLM clients to query security posture using natural language.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server enabling AI assistants to interact with the Qualys vulnerability management platform. Supports investigation, risk assessment, compliance, remediation, security overview, and report management.
      22 npm
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server for full Qualys portal management — expose VMDR, Policy Compliance, WAS, Cloud Agent, Container Security, TotalCloud, Patch Management, CSAM/GAV, EASM and administration to any MCP‑capable client.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server for Tenable Vulnerability Management and the Tenable One platform, enabling LLMs to query assets, vulnerabilities, scans, exposure metrics, attack paths, and more via natural language.
      2
      MIT