# Security Headers

> Security Headers is an open-source MCP server for security. Grades a site's security headers and explains each one, over stdio. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI
- **Website:** https://basitalisandhu.github.io/dev-mcp-servers/
- **Repository:** https://github.com/basitalisandhu/dev-mcp-servers/tree/HEAD/packages/security-headers
- **MCP Registry name:** io.github.basitalisandhu/mcp-security-headers
- **Categories:** security, developer tools
- **Listing updated:** 2026-11-15

## About

Scoring is explicit: CSP carries 25 points, HSTS 20, X-Frame-Options, X-Content-Type-Options, Referrer-Policy and Set-Cookie 10 each, and Permissions-Policy, COOP and CORP 5 each. Grades run from A+ (95% with no failing header) down to F. A Content-Security-Policy sent in report-only mode earns nothing because it is not enforced.

The live check sends a HEAD request (falling back to GET on 405 or 501) to a public http(s) URL and never downloads the body. It validates every redirect hop and refuses localhost, .local, .internal, private, loopback, link-local, CGNAT and cloud-metadata addresses. The README warns that this does not defeat DNS rebinding between the check and the connection.

It is one of ten small servers in the dev-mcp-servers repository, ships as a pinned container image and sends no telemetry. The README is blunt that a good grade means headers are configured well, not that the application is secure.

## Features

- **Live header check:** Fetches a public URL with up to 10 validated redirects and a 10 second timeout per request.
- **Offline grading:** Grades headers you already have, such as curl -I output, without any network access.
- **Weighted scoring:** Combines per-header weights into a letter grade from A+ to F.
- **Per-header explanations:** Returns the purpose, a recommended value and a reference for any single header.
- **Private-address refusal:** Blocks internal, loopback, link-local and cloud-metadata targets, including names that resolve to them.

## Good for

- Auditing a staging site's CSP and HSTS before launch
- Grading headers pasted from a curl -I run during a code review
- Explaining an unfamiliar response header to a teammate
- Checking cookie attributes and information-disclosure headers on a public page

## Install

### Claude Code (Terminal)

```sh
claude mcp add mcp-security-headers -- docker run -i --rm ghcr.io/basitalisandhu/mcp-security-headers:0.3.0
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-security-headers": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/basitalisandhu/mcp-security-headers:0.3.0"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp-security-headers": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/basitalisandhu/mcp-security-headers:0.3.0"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "mcp-security-headers": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/basitalisandhu/mcp-security-headers:0.3.0"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-security-headers": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/basitalisandhu/mcp-security-headers:0.3.0"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp-security-headers": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/basitalisandhu/mcp-security-headers:0.3.0"
      ]
    }
  }
}
```

## Tools

- `check_url_headers`: Requests a public URL and grades its response headers, following validated redirects.
- `grade_headers`: Grades headers you supply, with no network call.
- `explain_header`: Explains one header with its recommended value and a reference.

## FAQ

### Does it download page bodies?

No. It sends a HEAD request and only reads response headers.

### Can it scan internal hosts?

No. Localhost, private ranges and cloud-metadata addresses are refused, including hostnames that resolve to them.

### How do I install it?

Run the pinned container image ghcr.io/basitalisandhu/mcp-security-headers:0.3.0 with docker. The README says it is not on npmjs.com yet.

### Does a good grade mean the site is secure?

No. The README says it only shows the headers are configured well.

### Is Security Headers free?

Yes. Security Headers is open source, so you can use and self-host it for free.

### How do I add Security Headers to Claude Code?

Run this command in your terminal: claude mcp add mcp-security-headers -- docker run -i --rm ghcr.io/basitalisandhu/mcp-security-headers:0.3.0

### What are the best alternatives to Security Headers?

The closest alternatives to Security Headers are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/security-headers
