Skip to main content
Glama
Website Security Audit MCP Server

Website Security Audit MCP Server

by eazetech-co
README.md
# Website Security Audit MCP server

An MCP server that runs a passive security audit of a public website and returns a grade, the problems it found and a fix for each one. It runs the same checks as Eazetech's free [website security audit](https://eazetech.co/tools/website-security-audit), so Claude Code, Claude Desktop, Cursor and other MCP clients can check a site's public security setup.

It is read-only. It asks a site only for what the site sends to every visitor, and it will not connect to private, loopback, link-local or cloud metadata addresses.

**Only scan sites you own or have permission to check.**

## Tools

| Tool | Input | What it returns |
| --- | --- | --- |
| `audit_website_security` | `url` | The full audit: a score out of 100, a grade from A+ to F, and findings with a fix for each. Usually 3 to 10 seconds, at most about 40. |
| `check_security_headers` | `url` | The redirect chain, the security headers and the cookie flags of the final response, with a fix for each problem. No grade. |
| `check_security_txt` | `domain` | Whether the site publishes a security.txt file (RFC 9116), its fields, and whether it has expired. |

All three tools are marked `readOnlyHint: true` and `openWorldHint: true`, and each has an input schema and an output schema. Each result carries structured content that matches the output schema, and a plain-text summary of the same data. Page HTML is never returned, only the findings parsed from it.

The full audit returns the same shape as the website's tool (`target`, `domain`, `scannedAt`, `durationMs`, `score`, `grade`, `counts`, `redirects`, `findings`, `cached`), plus `notes`, which names any check that did not finish or saw only part of the page. Each finding has `severity`, `category`, `title`, `detail` and, for problems, `fix` and `effort`.

## The checks

| Area | What is checked |
| --- | --- |
| Transport | Plain HTTP, an HTTP to HTTPS redirect, a redirect that drops back to HTTP, redirect loops and long chains |
| Headers | Content-Security-Policy (missing, report-only, `unsafe-inline`, `unsafe-eval`, wildcards, missing directives), Strict-Transport-Security (missing, short, no `includeSubDomains`, only set after a redirect), X-Content-Type-Options, X-Frame-Options or `frame-ancestors`, Referrer-Policy, Permissions-Policy, Cross-Origin-Opener-Policy, Cross-Origin-Resource-Policy, and version numbers in Server, X-Powered-By and similar headers |
| Cookies | Secure, HttpOnly and SameSite on each cookie the landing page sets, graded by how sensitive the cookie name looks |
| Encryption | TLS 1.0 and 1.1 still accepted, TLS 1.3 offered |
| Certificate | Expired, issued for another name, self-signed, untrusted root, incomplete chain, days to expiry, SHA-1 or MD5 signature, RSA keys under 2048 bits |
| Email and DNS | SPF, DMARC, MTA-STS, CAA, number of name servers, and CNAME records that point at a deleted resource on a hosting service (subdomain takeover) |
| Page content | Third-party scripts and whether they carry integrity hashes, JavaScript libraries with known vulnerabilities (RetireJS signatures checked against the OSV database), mixed content, password fields and forms that post over plain HTTP, generator tags, directory listings and visible error traces |
| Process | security.txt, and a robots.txt that blocks the whole site |

### How the grade works

Each problem has a weight: critical 30 points, high 14, medium 6 and low 2. Low findings together cost at most 8 points. Findings marked `harden` are optional improvements: they are listed but never lower the score. The grades are A+ from 95, A from 85, B from 75, C from 65, D from 50, E from 30 and F below 30.

## The SSRF guard, and why it is here

An MCP server that fetches URLs for an agent is an attack target. A web page, an email or a document that the agent reads can contain text such as "audit http://169.254.169.254/latest/meta-data/", and a server that obeyed would fetch cloud credentials or internal pages for whoever wrote that text. This is server-side request forgery (SSRF), driven by prompt injection. The guard in [`src/net-guard.ts`](src/net-guard.ts) is the boundary that stops it, and it is the main reason this server exists as its own project.

1. Only `http` and `https` on ports 80 and 443 are accepted. Addresses with a username or password are refused. Query strings are removed before any request, because they can carry tokens.
2. IP addresses are refused, in every spelling the URL parser accepts: decimal (`2130706433`), hex, octal, short forms (`127.1`) and bracketed IPv6.
3. Each hostname is resolved once, and every answer is checked against an explicit block list: RFC 1918 ranges, loopback, link-local (which includes 169.254.169.254, the metadata address on AWS, Google Cloud and Azure), carrier-grade NAT (which includes Alibaba Cloud's 100.100.100.200), Azure's 168.63.129.16, multicast, reserved and documentation ranges, the IPv6 forms that carry an IPv4 address (IPv4-mapped, IPv4-compatible, NAT64, 6to4 and Teredo), and the IPv6 unique-local range that holds the AWS and Google Cloud IPv6 metadata addresses. If any answer is blocked, the host is refused, even when other answers are public.
4. The connection goes to the address that was checked, never back to the name, so the DNS answer cannot change between the check and the connection (DNS rebinding). The TLS probes use the same pinned address.
5. Redirects are followed by hand, at most 5, and every hop is resolved and checked again.
6. Each page request stops at 10 seconds and 3 MB, the whole redirect chain at 20 seconds, and policy files such as security.txt at 7 seconds and 100 KB. These are hard limits on total time, not idle timeouts. Responses are requested without compression.

Values that the site controls, such as header values, cookie names, meta tags, form addresses and DNS records, are cleaned before they appear in a result. Control characters, line breaks and invisible Unicode are removed, the length is capped, and the value is shown in double quotes.

The guard is unit-tested in [`test/net-guard.test.mjs`](test/net-guard.test.mjs), including redirects into blocked space and a name that answers with a public address first and a private one second.

## Install

You need Node.js 20.19 or later. The client starts the server with `npx`, so there is nothing else to install.

### Claude Code

```bash
claude mcp add website-security-audit -- npx -y @eazetech/website-security-audit-mcp
```

Add `--scope user` before the name to make it available in every project. Run `/mcp` inside Claude Code to check that it is connected.

### Claude Desktop

Open Settings, then Developer, then Edit Config. Add the server to `claude_desktop_config.json`, which is in `~/Library/Application Support/Claude/` on macOS and in `%APPDATA%\Claude\` on Windows:

```json
{
  "mcpServers": {
    "website-security-audit": {
      "command": "npx",
      "args": ["-y", "@eazetech/website-security-audit-mcp"]
    }
  }
}
```

Then restart Claude Desktop.

### Cursor

Add the server to `~/.cursor/mcp.json` to use it in every project, or to `.cursor/mcp.json` in one project:

```json
{
  "mcpServers": {
    "website-security-audit": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@eazetech/website-security-audit-mcp"]
    }
  }
}
```

### Other clients

Any MCP client that can start a stdio server can run it with `npx -y @eazetech/website-security-audit-mcp`. Its name in the official MCP Registry is `co.eazetech/website-security-audit`.

### Package name

The package is published as `@eazetech/website-security-audit-mcp`. If it is ever published without the `@eazetech` npm organisation, the unscoped name is `eazetech-website-security-audit-mcp`; use that name in the commands above instead.

## Example prompts

- "Audit the security of example.com and tell me what to fix first."
- "Check the security headers on https://www.example.com and write the Netlify `_headers` rules that would fix the problems."
- "Does example.com publish a security.txt? If not, draft one with our security contact."
- "Audit our three marketing sites and put every high and critical finding in one table."
- "We just deployed new headers. Run the header check on example.com again and confirm the HSTS finding is gone."

## What it connects to

- The site you name, over HTTP and HTTPS, on the validated address. Requests use the user agent `Mozilla/5.0 (compatible; EazetechSecurityAudit/1.0; +https://eazetech.co/tools/website-security-audit)`.
- Your system's DNS resolvers, for the site's address and its TXT, CAA, NS and CNAME records.
- `cdn.jsdelivr.net`, once per session, to download the RetireJS signature list.
- `api.osv.dev`, only when the page loads a library that the signatures recognise. It receives library names and versions, not the site's address.

Nothing is sent to Eazetech. Results are kept in memory for one minute so that repeat calls do not hit the site again, and each tool call writes one log line (tool, host, outcome, duration) to stderr.

## Limitations

- This is a first look at how a site is set up. It is not a penetration test or a certification. It does not log in, crawl, guess paths or test the application for vulnerabilities.
- It checks one page: the address you give, after redirects.
- By design it cannot check IP addresses, ports other than 80 and 443, or anything on a private network, such as localhost or a staging site on an internal address.
- Results depend on the network the server runs from. A site that serves different content by region, or that blocks automated clients, may answer it differently than it answers visitors.
- The email checks find the registrable domain (`example.co.uk` for `www.example.co.uk`) with a short rule, not the full Public Suffix List, so a few domains are read at the wrong level. The same rule decides which scripts count as third-party, so a company's own CDN on a different domain, such as `github.githubassets.com` for `github.com`, counts as another company.
- Library detection only sees a version that appears in a script's address, such as `/3.7.1/jquery.min.js`. Bundled code is not detected.
- The security.txt check does not follow redirects and does not verify OpenPGP signatures.
- A repeat audit of the same address within one minute returns the earlier result, marked `cached: true`.

## Development

```bash
npm install
npm test               # builds, then runs node --test
npm run test:offline   # skips the two tests that use real DNS
npm run inspect        # opens the MCP Inspector web client against the built server
```

The Inspector also has a CLI mode:

```bash
npx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/list --strict
npx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/call \
  --tool-name audit_website_security --tool-arg url=example.com
```

The Inspector 2.15 needs Node.js 22.23.4, 24.22.1, 26.12.1 or later, even though the server itself runs on 20.19.

The server is written in TypeScript on version 2 of the official MCP TypeScript SDK (`@modelcontextprotocol/server`) and serves over stdio with `serveStdio`, which handles both the 2025 protocol and the 2026-07-28 revision.

## Built by Eazetech

[Eazetech](https://eazetech.co) is an agentic AI studio in Lahore. We build MCP servers and integrations for teams ([MCP development](https://eazetech.co/services/mcp-development)) and carry out security reviews ([cybersecurity](https://eazetech.co/services/cybersecurity)). This server runs the same checks as our free [website security audit](https://eazetech.co/tools/website-security-audit), which you can also use in a browser.

## License

MIT. See [LICENSE](LICENSE).

TDQS

A4.5/5.0

Scored across 3 tools

Disambiguation4/5

Each tool targets a distinct scope: full audit, fast header/cookie check, and security.txt lookup. The main overlap is that audit_website_security includes header checks, but the descriptions clearly frame check_security_headers as a faster subset, so an agent can choose correctly.

Naming Consistency4/5

All names are snake_case and follow a verb_noun pattern (audit_..., check_..., check_...). The verbs differ between 'audit' and 'check', and audit_website_security adds a redundant 'website', but the convention remains readable and predictable.

Tool Count5/5

Three tools is well-scoped for a focused website security audit server. Each tool has a clear role: comprehensive audit, quick header check, and security.txt inspection.

Completeness4/5

The surface covers passive security auditing broadly, plus focused checks for headers/cookies and security.txt. Standalone DNS/TLS checks are not separate tools, but the full audit includes them, so there is no major dead end.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues