{
  "markdown": "# domain-security-mcp-server\n\n> An [MCP](https://modelcontextprotocol.io) server that lets an AI agent audit the **email and domain security** of any domain — SPF, DKIM, DMARC, MTA-STS, TLS-RPT, BIMI, DNSSEC, DNS, TLS/SSL and WHOIS — in plain language. **No API keys required.**\n\n[![ci](https://github.com/OrtaMarco/domain-security-mcp-server/actions/workflows/ci.yml/badge.svg)](https://github.com/OrtaMarco/domain-security-mcp-server/actions/workflows/ci.yml)\n[![npm](https://img.shields.io/npm/v/domain-security-mcp-server)](https://www.npmjs.com/package/domain-security-mcp-server)\n[![MCP](https://img.shields.io/badge/MCP-server-blue)](https://modelcontextprotocol.io)\n[![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6)](https://www.typescriptlang.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)\n\nBuilt on the **v2 MCP SDK**: the server speaks the **2026-07-28** protocol\nrevision and keeps accepting 2025-era clients (Claude Desktop, Claude Code,\nCursor) from the same factory — the era is negotiated per connection, so there\nis nothing to configure on either side.\n\nAsk Claude *\"Is acme.com protected against email spoofing?\"* and it runs a full\nauthentication audit and hands you a graded report with prioritised fixes —\ninstead of you pasting a domain into five different web tools.\n\n```\n> Is ortamarco.me protected against email spoofing?\n\n  email_auth_audit(domain=\"ortamarco.me\")\n\n  Grade: A (95/100) · MX: present\n  ✅ SPF ends in '-all' (hard fail). 3/10 DNS lookups.\n  ✅ DMARC policy is enforced ('p=reject').\n  ✅ DKIM key found for selector: google.\n  Top recommendation: add a TLS-RPT record for delivery-failure reports.\n```\n\n---\n\n## Why this exists\n\nThe email-security ecosystem is full of single-purpose web checkers (SPF here,\nDMARC there, WHOIS somewhere else) and the few MCP equivalents are locked behind\npaid API tokens. This server brings the whole **deliverability & domain-security\ntoolkit** to any MCP client, key-free, with one headline workflow tool that does\nthe synthesis for you.\n\nIt is the agent-facing companion to the network tools at\n[ortamarco.me](https://ortamarco.me) and shares the same battle-tested core\n(public-resolver DNS, host validation, timeouts).\n\n## Tools\n\n| Tool | What it does |\n|---|---|\n| **`email_auth_audit`** ⭐ | One-call SPF + DKIM + DMARC + MX audit → 0–100 score, A–F grade, prioritised fixes |\n| `spf_check` | Parse SPF; recursively count DNS lookups vs the RFC 7208 limit of 10; flag `+all`/`?all` |\n| `dmarc_check` | Parse DMARC policy (`p`, `sp`, `rua`, `pct`, `aspf`/`adkim`) with warnings |\n| `dkim_check` | Probe `<selector>._domainkey` keys (supply selectors or use common ones) |\n| `mta_sts_check` | Validate the `_mta-sts` TXT **and** the `.well-known/mta-sts.txt` policy + mode |\n| `tls_rpt_check` | Check the `_smtp._tls` TLS-RPT record |\n| `bimi_check` | Check the `default._bimi` BIMI record |\n| `dnssec_check` | DS/DNSKEY presence + DNSSEC `AD` validation flag (via DoH) |\n| `dns_lookup` | All record types (A/AAAA/CNAME/MX/NS/TXT/SOA) via public resolvers |\n| `ssl_certificate` | TLS cert issuer, validity window, days-to-expiry, SANs, fingerprint |\n| `whois_lookup` | Registrar, dates, name servers, status (raw port-43 WHOIS, IANA-resolved) |\n| `reverse_dns` | PTR records for an IP |\n| `ip_geolocation` | Offline IP geolocation + reverse DNS |\n| `mx_lookup` | Mail servers (MX) with priority and resolved IPs |\n| `caa_check` | Which CAs may issue TLS certificates (CAA records) |\n| `blacklist_check` | IP/domain against open-access email DNSBLs |\n| `dns_propagation` | Compare a record across 5 public resolvers worldwide |\n| `http_security_headers` | Grade a site's HSTS, CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy and COOP |\n| `analyze_email_headers` | Parse raw headers → SPF/DKIM/DMARC verdicts + Received hop chain with delays |\n\nEvery tool is **read-only**, declares an `outputSchema` and returns\n`structuredContent` (validated by the SDK) alongside human-readable Markdown\n(default) or JSON (`response_format=\"json\"`), plus actionable error messages.\n\n## Install\n\nRequires **Node.js 20.18+**. Nothing to clone — every MCP client can run it with `npx`.\n\n## Use it with Claude Code\n\n```bash\nclaude mcp add domain-security -- npx -y domain-security-mcp-server\n```\n\n## Use it with Claude Desktop or Cursor\n\nAdd to `claude_desktop_config.json` (or `~/.cursor/mcp.json`) — see [`examples/`](./examples/claude_desktop_config.json):\n\n```json\n{\n  \"mcpServers\": {\n    \"domain-security\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"domain-security-mcp-server\"]\n    }\n  }\n}\n```\n\nOn Windows use `\"command\": \"cmd\"` with `\"args\": [\"/c\", \"npx\", \"-y\", \"domain-security-mcp-server\"]`.\nRestart the client, then ask: *\"Audit the email security of stripe.com.\"*\n\n## Self-host (HTTP transport)\n\nThe same server speaks stateless **Streamable HTTP** for remote or multi-client\nuse. One endpoint serves both protocol eras and there is no session state, so no\n`Mcp-Session-Id` header is issued or expected.\n\n```bash\nTRANSPORT=http npx -y domain-security-mcp-server\n# POST JSON-RPC to http://127.0.0.1:3000/mcp   ·   health at /healthz\n```\n\nIt is **safe by default**: it binds to `127.0.0.1` and only accepts `localhost`\n`Host` and `Origin` headers, which blocks DNS-rebinding attacks from a web page.\nTo expose it — for example behind Coolify or Traefik — opt in explicitly:\n\n| Variable | Default | Purpose |\n|---|---|---|\n| `TRANSPORT` | `stdio` | `http` to serve Streamable HTTP |\n| `PORT` | `3000` | Listening port |\n| `HOST` | `127.0.0.1` | Bind address; `0.0.0.0` to accept remote connections |\n| `ALLOWED_HOSTS` | — | Comma-separated hostnames the `Host` header may carry (e.g. `mcp.example.com`) |\n| `ALLOWED_ORIGINS` | — | Comma-separated origins allowed to call from a browser |\n| `MCP_AUTH_TOKEN` | — | If set, every request needs `Authorization: Bearer <token>` |\n\nBinding to a non-loopback address without `ALLOWED_HOSTS` or `MCP_AUTH_TOKEN`\nworks, but the server says so on stderr. With Docker (the image sets `HOST=0.0.0.0`):\n\n```bash\ndocker build -t domain-security-mcp .\ndocker run -p 3000:3000 -e ALLOWED_HOSTS=mcp.example.com -e MCP_AUTH_TOKEN=change-me domain-security-mcp\n```\n\n## Security\n\nThe tools reach out to hosts that the *caller* names, so every outbound\nconnection is screened against server-side request forgery:\n\n- Private, loopback, link-local (cloud metadata), shared, multicast and reserved\n  addresses are refused in every spelling, including IPv4 embedded in IPv6\n  (`[::ffff:169.254.169.254]`).\n- The check happens **at connect time**, on the address the socket is actually\n  about to use, so DNS rebinding and names only an internal resolver knows are\n  refused too. Redirects are followed by hand and every hop is re-checked.\n- Response bodies, redirects, WHOIS referrals and every network call are capped\n  and time-limited.\n\nFound a problem? Please open a [private security advisory](https://github.com/OrtaMarco/domain-security-mcp-server/security/advisories/new).\n\n## Develop\n\n```bash\nnpm run dev      # tsx watch (stdio)\nnpm run inspect  # open the MCP Inspector against the built server\nnpm run build     # type-check + emit dist/\nnpm run typecheck # type-check only\nnpm test          # offline unit tests: SSRF guard, SPF/DMARC/DKIM scoring,\n                  # header parsing, HTTP transport defaults\nnpm run smoke     # call all 19 tools on BOTH protocol eras and validate\n                  # structuredContent against each tool's outputSchema\n```\n\n[`evals/`](./evals/) holds a 10-question LLM evaluation set (stable, verifiable)\nand instructions for running it — see [`evals/README.md`](./evals/README.md).\n\n## How it works\n\n```\nsrc/\n├── index.ts        # transport selection (stdio | http), v2 SDK entry points\n├── server.ts       # factory: registers every tool on one McpServer\n├── core/           # pure logic, no MCP coupling — reusable & testable\n│   ├── validate.ts # input validation and the address classifier\n│   ├── netguard.ts # connect-time SSRF guard, redirect-safe fetch, capped bodies\n│   ├── dns.ts      # public-resolver DNS + DoH client\n│   ├── net.ts      # MX, CAA, DNSBL and propagation checks\n│   ├── tls.ts      # certificate inspection and trust\n│   ├── whois.ts    # port-43 WHOIS with IANA/registrar referral\n│   ├── http.ts     # security-header grading\n│   ├── geoip.ts    # offline IP geolocation (database loaded on first use)\n│   ├── email-headers.ts  # raw header parsing and hop timing\n│   └── email-auth.ts  # SPF/DKIM/DMARC/MTA-STS/TLS-RPT/BIMI/DNSSEC + scoring\n└── tools/          # thin MCP wrappers (Zod schemas, descriptions, formatting)\n```\n\nThe `core/` layer is deliberately free of any MCP types, so the exact same logic\npowers both this server and the web tools on ortamarco.me.\n\n## License\n\nMIT © [Marco Orta](https://ortamarco.me)\n",
  "bytes": 8887,
  "sha": "36d2777a9f0dca81d771b831c572a64bbe91895acbb3903c4711dba3d585221a",
  "repo_slug": "ortamarco/domain-security-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_ortamarco_domain_security_mcp__626442e3/readme"
}