secheaders-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@secheaders-mcp How secure are the HTTP security headers on example.com?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
secheaders-mcp
An MCP (Model Context Protocol) server that lets an AI assistant check a website's HTTP security headers. Ask it something like "How secure are the headers on example.com?" and the assistant calls this server, gets back a grade from A to F, and explains which headers are missing and how to fix them.
I built it to learn MCP hands-on, combining it with my background in web application security.
Tools
Tool | What it does | Network? |
| Fetches a public http(s) URL with one GET and grades its security headers | Yes, a single passive request |
| Grades headers you paste as text ( | No |
| Explains what a header protects against and gives a safe example value | No |
What it checks: HSTS, Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, Referrer-Policy and Permissions-Policy. It also flags version leaks (Server, X-Powered-By), an HSTS max-age under 180 days, and a CSP that allows unsafe-inline or unsafe-eval.
Related MCP server: web-security-guard
Security design
Giving an AI agent a tool that fetches URLs is risky. A prompt-injection attack could trick the agent into calling the tool against http://127.0.0.1/admin or the cloud metadata endpoint 169.254.169.254. This is SSRF (server-side request forgery). To prevent it, check_url:
only accepts
http://andhttps://URLs, sofile://,ftp://andgopher://are rejectedresolves the hostname first and refuses private, loopback, link-local and reserved IPs
sends one passive GET with a 10-second timeout, so it does no scanning or fuzzing
These rules are covered by tests.
Quick start
git clone https://github.com/hellonimen/secheaders-mcp.git
cd secheaders-mcp
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pytest -v # 17 testsUse it with Claude Desktop (or any MCP client)
Add this to claude_desktop_config.json, then restart Claude Desktop:
{
"mcpServers": {
"secheaders": {
"command": "python",
"args": ["-m", "secheaders_mcp.server"]
}
}
}If you installed it in a virtual environment, use the full path to that environment's python.
Try it with the MCP Inspector
mcp dev src/secheaders_mcp/server.pyHow it's built
src/secheaders_mcp/
checks.py # pure logic: grading + SSRF guard (no MCP code, easy to unit test)
server.py # MCP layer: 3 tools registered with @mcp.tool(), stdio transport
tests/
test_checks.py # unit tests for grading and SSRF blocking
test_server.py # end-to-end: a real MCP client lists and calls the tools in-processBuilt on the official MCP Python SDK (
MCPServer, v2).The business logic is kept separate from the MCP layer, so the same checks could be reused in a CLI or a CI job.
GitHub Actions runs the test suite on Python 3.11 and 3.12 for every push.
Scoring
The score is the percentage of the 6 recommended headers present, minus 5 points for each version leak and each weak setting. Grades: A ≥ 90, B ≥ 75, C ≥ 50, D ≥ 25, otherwise F.
Ideas for next steps
A TLS certificate tool (expiry date, protocol version)
Cookie flag checks (
Secure,HttpOnly,SameSite)A Streamable HTTP transport, so a team can share one server
Disclaimer
Only scan sites you own or have permission to test. check_url makes one ordinary request, the same as a browser visit.
License
MIT
Available Tools
3 toolsanalyze_raw_headersA
Grade HTTP response headers pasted as text, one 'Name: value' per line. No network used.
Inputs: raw_headers (required).
check_urlA
Fetch a public http(s) URL and grade its security headers (A-F) with fixes.
Passive only: sends one GET request, the same as a browser visiting the page.
Inputs: url (required).
explain_headerC
Explain what a security header protects against and give a safe example value.
Inputs: header (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Although check_url and analyze_raw_headers both grade security headers, their boundary is explicit: one fetches a live URL while the other processes pasted header text. explain_header is clearly educational and separate from grading.
All three tool names use a consistent snake_case verb_noun pattern: check_url, analyze_raw_headers, explain_header. The naming is predictable and easy to infer.
Three tools are well-scoped for a security-header grading service: live scan, offline scan, and header explanation. Each tool covers a distinct workflow with no filler.
The surface covers the core tasks of grading a live URL, grading pasted headers, and explaining individual headers. Minor gaps exist, such as no consolidated reference/list of supported headers or explicit remediation output for analyze_raw_headers, but these are workable.
Maintenance
Related MCP Connectors
Scan a website's HTTP security headers (HSTS, CSP, framing, COOP/CORP, cookies). Score + fixes.
Free SEO, AI visibility (AI crawlers, llms.txt, JSON-LD) and security-header checks for any URL.
HTTP, DNS, SSL, WHOIS, ping, security-header, SEO and AI-readiness checks for any website.
Audits security headers + TLS (HSTS, CSP, cert, cookies) for any site. $1.50/call via x402.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude to scan a website's HTTP security headers and receive an A–F grade against OWASP best practices, including per-header pass/warn/fail results and copy-paste fixes for missing headers.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables 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
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to scan any website's HTTP security headers — HSTS, CSP, framing, COOP/CORP, and cookies — returning a score along with fix snippets.MIT
- AlicenseAqualityCmaintenanceEnables AI agents and developers to audit any URL or domain for seven critical OWASP HTTP security headers, returning an A+ to F grade plus actionable Nginx, Apache, Caddy, and Cloudflare remediation snippets. It also probes /.well-known/security.txt and /security.txt to surface responsible vulnerability disclosure contacts, bug bounty scopes, and PGP keys.2MIT