Skip to main content
Glama
momoaftabi

qa-sec-scan-mcp-server

by momoaftabi

qa-sec-scan-mcp-server

An MCP server that passively scans HAR files — the kind QA automation already produces (e.g. via Playwright's recordHar option) — for common security issues.

It never sends network requests of its own. It only analyzes HTTP traffic that already happened, captured in a .har file you point it at. That makes it safe to run against any environment, including production, since it can't cause side effects.

What it catches

Rule

Category

Severity

HDR-001

Missing Strict-Transport-Security header

Medium

HDR-002

Request made over plaintext HTTP

High

COK-001

Session cookie missing Secure/HttpOnly/SameSite

High

DATA-001

Secret/credential pattern in response body

Critical

DATA-002

Sensitive-looking parameter in the URL

Medium

DATA-003

Luhn-valid payment card number in response body

Critical

CORS-001

CORS reflects the request's Origin unconditionally

High

CORS-002

Wildcard CORS origin combined with credentials

Critical

Related MCP server: middleBrick

Setup

npm install
npm run build

Producing a HAR file from your test suite

This scanner needs response headers, cookies, and response bodies to work — so however you generate the HAR, make sure content isn't stripped out.

Playwright

const context = await browser.newContext({
  recordHar: { path: "test-results/network.har" },
  // defaults: mode "full", content "embed" for a .har path — includes headers, cookies, and bodies.
  // Don't override to mode: "minimal" or content: "omit", or the rules that inspect
  // response bodies (DATA-001, DATA-002, DATA-003) and cookies (COK-001) will have nothing to check.
});

// ... run your test, make requests via `context` or any page created from it ...

await context.close(); // the HAR is only written to disk once the context closes

If you're using the Playwright Test runner rather than driving browser/context by hand, the equivalent is setting recordHar in your project's use config, or per-test via test.use({ recordHar: { path: "..." } }).

Other tools that can emit HAR (mitmproxy, browser DevTools' "Save as HAR", har-recorder style middlewares) work too — harParser.ts reads the standard HAR 1.2 format, it isn't Playwright-specific.

Using this MCP with an AI client

For interactive, AI-assisted triage — asking an assistant to scan a HAR and explain what it finds, the way this project was built and tested — add the server to your MCP client's config (e.g. Claude Desktop):

{
  "mcpServers": {
    "qa-sec-scan": {
      "command": "node",
      "args": ["/absolute/path/to/qa-sec-scan-mcp-server/dist/index.js"]
    }
  }
}

Restart your client after any rebuild. MCP clients keep a long-lived server process running; a tsc rebuild overwrites the files on disk but does not restart the already-running process, so it'll keep serving stale code until you restart the client.

Tool: secscan_scan_har

Args:

  • harFilePath (string) — absolute path to a .har file

  • response_format ("markdown" | "json", default "markdown")

Returns a scan summary (counts by severity) plus a list of findings, each with the rule that fired, the offending request, evidence, and a remediation suggestion. Text responses are capped at the 50 highest-severity findings (worst first); the full, untruncated result set is always available via the tool's structured content, for any client reading that instead of the text.

In practice: point your AI client at a HAR file your test suite produced and ask it to scan for security issues — no manual invocation syntax needed, the assistant calls the tool for you.

Using this as a CI gate (no AI client needed)

If you want a deterministic pass/fail check in your pipeline instead — build fails if any critical finding shows up — use the bundled CLI, which runs the same scan logic directly without going through the MCP protocol at all:

npm run gate -- path/to/network.har

Exits 0 if there are no critical findings, 1 if there are (or if the HAR couldn't be scanned at all — the gate fails closed on errors rather than silently passing).

Example as a step in a CI workflow that already runs Playwright:

- name: Run Playwright tests
  run: npx playwright test

- name: Security gate on captured HAR
  run: npm run gate -- test-results/network.har

If your suite produces multiple HAR files (one per test, say), loop the gate command over each path rather than hardcoding one.

Development

npm run dev    # tsx watch — fast iteration, does NOT type-check
npm run build  # tsc — the real correctness gate for the code itself

Architecture

HAR file → harParser.ts → Transaction[] → rules/*.ts (each independent) → scanEngine.ts → ScanReport │ ┌─────────────────────┴─────────────────────┐ │ │ src/tools/scanHar.ts src/cli.ts (MCP tool, for AI clients) (deterministic CI gate)

Parsers translate raw formats into a normalized Transaction. Rules never touch raw HAR shapes — they only see Transaction. The scan engine and rule set are shared between both consumers (the MCP tool and the CLI gate); only the presentation and exit-code logic differ.

Available Tools

1 tool
secscan_scan_harScan HAR File for Security IssuesA
Read-onlyIdempotent

Passively scans an existing HAR file (typically produced by QA test automation, e.g. Playwright's recordHar option) for security issues: missing security headers, insecure cookie flags, CORS misconfiguration, and more.

This tool does NOT send any network requests of its own — it only analyzes HTTP traffic that already happened, captured in the HAR file. Safe to run against any environment, including production.

Args:

  • harFilePath (string): Path to the .har file to scan.

  • response_format ('markdown' | 'json'): Output format (default: 'markdown').

ParametersJSON Schema
NameRequiredDescriptionDefault
harFilePathYesPath to a HAR (.har) file to scan, typically produced by Playwright's recordHar option or a browser DevTools export.
response_formatNoOutput format: 'markdown' for a human-readable summary, or 'json' for the full structured report.markdown

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations (readOnlyHint, idempotentHint, destructiveHint), the description explicitly discloses a key behavioral trait: it makes no network requests of its own and only analyzes existing traffic. It further reassures safety against any environment, including production, and lists concrete categories of issues scanned for. This is valuable context beyond the structured annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded: the first sentence states the core purpose, the second addresses safety and behavioral scope, and the Args section is concise. Every sentence adds useful information, with no filler or repetition beyond an acceptable parameter summary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter tool with no output schema, the description is complete enough: it explains input expectations, the passive nature, and the output format options via response_format. It does not provide detailed return-value structure, but the markdown/json choices are described in the schema, and the absence of siblings reduces ambiguity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already fully documents both parameters, including descriptions, defaults, and enums, so the schema coverage is 100%. The description repeats the parameter names and basic types but adds little beyond what the schema already conveys, so it meets the baseline without adding substantial new meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Passively scans an existing HAR file') and a specific resource ('HAR file'), and enumerates the types of findings (security headers, cookie flags, CORS misconfiguration). It clearly distinguishes this from active scanning by emphasizing it only analyzes already-captured traffic.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context for when the tool is appropriate: scanning HAR files typically produced by QA automation or Playwright's recordHar option. It also implies an exclusion by stating it does not send network requests, making it safe for production, though it does not explicitly enumerate alternatives or say 'use this instead of X'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 1 tool updatev1.0.0
    • First observedsecscan_scan_har

TDQS

A4.4/5.0

Scored across 1 tool

Disambiguation5/5

With a single tool there is no risk of overlap or misselection. secscan_scan_har is precisely described as a passive HAR security scanner, making its purpose unmistakable.

Naming Consistency5/5

The tool name follows a clear snake_case verb_object convention with a consistent secscan_ prefix. Having only one tool means there are no conflicting naming patterns to confuse agents.

Tool Count3/5

One tool is at the low end of the scale and the server name suggests a broader security-scanning purpose, so the surface feels thin. That said, the single tool is substantial and not trivial, so it is borderline rather than severely undersized.

Completeness4/5

For the described passive HAR-scanning domain, the tool covers the full input-analysis-output flow with a useful format option. The only potential gap is the absence of additional scan types or live-traffic scanning, but those are explicitly outside the tool's stated scope.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables security scanning of code projects to identify common vulnerabilities like XSS, injections, SSRF, and path traversal issues. Provides local, offline scanning with severity-grouped results and actionable fix suggestions for improving code security.
    38 npm
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Scan APIs for security vulnerabilities and get OWASP risk scores. Detects auth bypass, BOLA/IDOR, data exposure, prompt injection, and 12+ security categories.
    24 npm
    Apache 2.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    Audits HAR captures locally with MCP tools for triage, findings, vendor blast radius, CSP generation, and sanitization—no network calls, redacted by default.
    42 npm
    1
    MIT