MCP & integrations — wire qualys-cli into Claude / Cursor / agents
qualys-cli mcp runs a Model Context Protocol stdio server.
Every CLI command is published as an MCP tool whose JSON Schema is
generated from its option signature, so Claude Desktop, Cursor, and any
MCP-aware agent can drive the full Qualys API surface natively.
No console output by design
MCP servers speak JSON-RPC on stdin / stdout;
any extra output would corrupt the protocol. So when you run
qualys-cli mcp in a terminal it just sits silently waiting
for a client to write a request to stdin. To verify it's
alive, paste this and press Enter:
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}
You should see a single JSON line back. Ctrl-C to exit.
1 · Find the Claude Desktop config file
| OS | Path |
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
2 · Use the absolute path to qualys-cli
Claude Desktop launches MCP servers without a shell, so qualys-cli
on PATH won't be found. Resolve the absolute path:
which qualys-cli
# e.g. /Users/you/.local/bin/qualys-cli (pipx install)
# /Users/you/repo/.venv/bin/qualys-cli (uv venv)
3 · Add to claude_desktop_config.json
{
"mcpServers": {
"qualys-cli": {
"command": "/absolute/path/to/qualys-cli",
"args": ["mcp"],
"env": {
"QUALYS_PROFILE": "default",
"QUALYS_AUDIT_LOG": "/Users/you/.config/qualys-cli/audit.log"
}
}
}
}
If you already have other MCP servers, add the
"qualys-cli": {…} entry alongside them inside the existing
mcpServers object — don't create a second block.
4 · Fully relaunch Claude Desktop
Cmd-Q (not just close the window) then reopen. Servers are
only re-scanned on a full relaunch. In a new chat, click the
🔌 tools icon at the bottom-right of the input box —
you should see qualys-cli with ~227 tools listed using
underscore-separated names (vm_host_list,
csam_asset_list, pm_job_list,
csam_vuln_list-easm, …). Anthropic's tool-name validator
requires ^[a-zA-Z0-9_-]{1,64}$, so the MCP server uses
_ as the path separator (not .); CLI verbs
with hyphens such as rotate-jwt are preserved intact.
5 · Troubleshoot via the Claude Desktop logs
tail -f ~/Library/Logs/Claude/mcp*.log
| Log / error says | Fix |
spawn qualys-cli ENOENT | Use the absolute path to the binary (step 2). |
Error: No username for profile 'default' | Run qualys-cli configure once in a terminal so creds land in the keyring, then relaunch Claude. |
JSONDecodeError on first frame | Something on stdout is corrupting the protocol. Make sure no print() lurks in a startup hook. |
EPIPE on shutdown | Harmless — expected when Claude tears the server down. |
tools.N.FrontendRemoteMcpToolDefinition.name: String should match pattern '^[a-zA-Z0-9_-]{1,64}$' | Upgrade qualys-cli — older builds emitted tool names with dots (vm.host.list); current builds use underscores (vm_host_list) which match Anthropic's validator. |
Validator complains about id being null / missing, plus unrecognized_keys: ["error"] on responses | Upgrade qualys-cli — older builds responded to JSON-RPC notifications (e.g. notifications/initialized) with a method-not-found error frame and id: null, which Anthropic's strict validator rejects. Current builds drop notifications silently and only respond to actual requests. |
Test before wiring Claude Desktop — use the official MCP inspector
Browse the tool catalogue, fire tools/list and
tools/call interactively, and see every JSON-RPC frame on
the wire — far easier than tailing logs:
npx @modelcontextprotocol/inspector qualys-cli mcp
Audit trail of MCP-driven calls
The MCP server runs each tool by shelling out to a fresh
qualys-cli process in agentic mode, so every Claude-driven
invocation lands in the audit log with its own correlation ID — exactly
as if a human had typed the command:
tail -f ~/.config/qualys-cli/audit.log | jq .
Cursor & other MCP clients
Cursor's ~/.cursor/mcp.json uses the same shape as Claude
Desktop's config — drop in the identical "qualys-cli"
entry. Any MCP-aware client (Continue.dev, Cline, Zed AI, custom agents
via the @modelcontextprotocol/sdk packages) can drive it
too — the JSON-RPC interface is standard.
Alternative — local HTTP bridge
Prefer REST over MCP? qualys-cli serve boots a localhost
HTTP server on 127.0.0.1:8765 with three endpoints:
GET / (health), GET /tools (catalogue),
POST /run (invoke a command). Useful for low-code tools,
Postman collections, and dashboards.