Skip to main content
Glama
mcp-headers

mcp-headers

by CACTUSCASH

mcp-headers

An MCP server that lets Claude scan a website's HTTP security headers and grade them A–F.

Add it to Claude Desktop or Claude Code, then just ask:

"How are example.com's security headers?"

Claude calls the scan_security_headers tool, which fetches the site server-side, checks it against the OWASP secure-headers set, and hands back a grade plus the exact header to add for anything that's missing — so the model isn't guessing.

Security-header grade for https://example.com/: D (64/100)

❌ Content-Security-Policy — No CSP; nothing constrains where scripts load from.
    fix: Content-Security-Policy: default-src 'self'; object-src 'none'; base-uri 'self'
✅ Strict-Transport-Security — HSTS enforced (730 days).
❌ X-Frame-Options — Missing; page can be framed for clickjacking.
    fix: X-Frame-Options: SAMEORIGIN
...

Why

Language models are confidently wrong about live sites — they'll "remember" a CSP that isn't there. This server makes that one thing checkable: it reads the actual response and grades it deterministically, so Claude can give a real answer instead of a plausible one. It's a small, focused example of the pattern I like — give the model a narrow, reliable tool instead of asking it to know everything.

Related MCP server: web-security-guard

The tool

Tool

Input

Returns

scan_security_headers

url (string)

An A–F grade, per-header pass/warn/fail, and a copy-paste fix for each gap

It grades seven headers (CSP, HSTS, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy, Cross-Origin-Opener-Policy), penalises stack-disclosing headers (X-Powered-By, versioned Server), follows redirects, and times out after 10 seconds.

Install

npm install
npm run build

Then point your MCP client at the built server.

Claude Desktop — add to claude_desktop_config.json:

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

Claude Code:

claude mcp add headers node /absolute/path/to/mcp-headers/dist/index.js

Restart the client and ask it to scan a site.

How it's built

  • TypeScript, ESM, no framework — just the official @modelcontextprotocol/sdk and zod for the tool schema.

  • One tool, one file (src/index.ts). The grading logic is a pure function so it's easy to read and extend.

  • Talks stdio, so it runs anywhere an MCP client can spawn a process.

License

MIT © Sa'ood Williams

Available Tools

1 tool
scan_security_headersA

Fetch a website and grade its HTTP security headers A–F against OWASP best practices, listing what is missing and the exact header to add.

Inputs: url (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 1 tool

    Disambiguation5/5

    Exactly one tool exists, so there is no possibility of selecting between overlapping tools. The purpose is clear and unique.

    Naming Consistency5/5

    The tool name follows a clean verb_noun pattern (scan_security_headers) that aligns with its function. No conflicting conventions are present.

    Tool Count3/5

    One tool is borderline for a server focused on security headers; it covers a narrow task but feels thin for a general 'headers' server. Not excessively large, yet minimal.

    Completeness4/5

    The tool fully accomplishes its stated purpose of fetching and grading security headers, including actionable missing headers. Minor gap: no raw header output or batch scanning, but core functionality is sound.

    Maintenance

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to audit URLs for security headers, generate CSP Level 3 policies, compute SRI hashes, evaluate WCAG 2.2 contrast, and remediate headers.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables scanning any website's HTTP security headers to obtain Mozilla Observatory grades, detailed pass/fail test results with remediation guidance, and grade distribution context.
      308 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables Claude to run safe, read-only diagnostics against servers and websites — certificate chains and expiry, HTTP status/redirects/security headers, DNS records, email authentication (SPF, DKIM, DMARC, MTA-STS, TLS-RPT) and sitemaps. Every check returns severity-tagged findings with concrete fixes, plus a 0-100 score and A-F grade, without any ability to modify the target.
      8
      31 npm
      MIT