
Security Headers
io.github.basitalisandhuv0.1.1Updated Oct 5, 2026
Fetch a URL's response headers and grade CSP, HSTS, X-Frame-Options and related security headers.
Overview
Fetches a public URL's HTTP response headers and grades its security headers, with per-header explanations and recommendations.
- What it does
- The server exposes three tools. check_url_headers sends a HEAD request (falling back to GET on 405/501) to a public http(s) URL, follows redirects and grades the security headers on every hop. grade_headers applies the same grading to header sets you already have, without any network access. explain_header returns the purpose, recommended value and reference for a single header. Grading covers CSP, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, the Cross-Origin-* headers, Set-Cookie attributes and information-disclosure headers, producing a score and a letter grade.
- When to use it
- Useful when you want an assistant to audit the security headers of a site you own or are reviewing, to compare headers captured elsewhere, or to look up what a specific header should be set to. It is a configuration check, not a penetration test.
- Requirements
- Runs locally over stdio as an npm package (npx @basitalisandhu/mcp-security-headers) or as an OCI image via Docker; Node.js is needed for the npm route. No accounts, API keys or environment variables are declared. Network access is required for check_url_headers; grade_headers and explain_header work offline. Desktop clients only.
Installation
In SourceWeft
- Open Security Headers in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
security-headers MCP server
Fetches a public URL's response headers and grades Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, the Cross-Origin-* headers, Set-Cookie attributes and information-disclosure headers, with an explanation and a recommendation per header. The response body is never downloaded.
Part of dev-mcp-servers. Stdio transport only; the server never opens a port.
Tools
Install
Claude Code:
Add -s user to make it available in every project. Any client that reads .mcp.json (Claude Code, Claude Desktop, Cursor):
Pin the version as shown so that an update to the package cannot change what runs in your editor without you noticing. From a checkout, use "command": "node", "args": ["<path>/packages/security-headers/dist/index.js"] after npm install && npm run build at the repository root.
What it touches
- Network: One request to the URL you give plus at most
max_redirectshops, each validated. 10 s timeout per request. The host is resolved and every address checked before connecting; this does not defeat DNS rebinding between the check and the connection, so do not point the tool at hosts you do not trust to answer honestly. No telemetry. - Local files: None.
- Telemetry: none.
Notes
- Scores: CSP 25, HSTS 20, X-Frame-Options 10, X-Content-Type-Options 10, Referrer-Policy 10, Set-Cookie 10, Permissions-Policy 5, COOP 5, CORP 5. Grades: A+ (95% and no fail), A (85% and no fail), B (70%), C (55%), D (40%), otherwise F.
- A report-only CSP earns nothing: it is not enforced.
- A good grade means the headers are configured well, not that the application is secure.
Build and test
Tests use node:test and the SDK's in-memory transport; they do not reach the network.
Licence
MIT. See LICENSE.
Source: packages/security-headers/README.md at commit 58c8c95
Tools
0Version history
1- v0.1.1LatestOct 5, 2026

