certguard-mcp
certguard-mcp — Offline X.509 Chain, SPKI Key Parity & RFC 6125 SAN MCP Server, CLI & GitHub Action
Zero-dependency, 100% offline Model Context Protocol (MCP) Server, CLI, and GitHub Action enabling AI coding agents (Claude Desktop, Claude Code, Cursor, Windsurf, Antigravity) and pull-request CI pipelines to audit X.509 PEM/DER certificate chains, prove mathematical SubjectPublicKeyInfo (SPKI) parity across Certificate, CSR, and Private Key without exposing private key scalars, validate RFC 6125 wildcard SubjectAltName coverage, and extract gateway hexadecimal serial numbers & SHA-256 SPKI pins.
MCP Tools Exposed (stdio)
Tool | Purpose | Safety Annotations |
| Decodes X.509 PEM or Base64 DER bundles, detects scrambled |
|
| Verifies mathematical |
|
| Validates target hostnames and IPv4/IPv6 literals against X.509 |
|
| Extracts uppercase contiguous Hex serial numbers ( |
|
Related MCP server: TLS Radar
Quick Start (MCP Client & Local CLI)
# Start MCP server over stdio (supports both NDJSON and Content-Length framing)
npx -y github:z121245017-ai/certguard-mcp
# List MCP tool schemas from terminal
npx -y github:z121245017-ai/certguard-mcp --list
# Audit a fullchain.pem bundle and verify RFC 6125 hostname coverage (exits 2 on blocking findings)
npx -y github:z121245017-ai/certguard-mcp --cert ./certs/fullchain.pem --hostname api.example.com --strict
# Invoke any MCP tool directly via --cli
npx -y github:z121245017-ai/certguard-mcp --cli verify_spki_key_and_csr_match '{"certPath":"./certs/fullchain.pem","keyPath":"./certs/server.key"}'Claude Desktop / Cursor / Windsurf / Antigravity Config
{
"mcpServers": {
"certguard": {
"command": "npx",
"args": ["-y", "github:z121245017-ai/certguard-mcp"]
}
}
}Docker (node:22-alpine, non-root USER node)
docker build -t certguard-mcp .
docker run -i --rm certguard-mcpGitHub Action (z121245017-ai/certguard-mcp@v1)
Audit public .pem, .crt, and .cer X.509 certificate bundles in pull requests and scheduled workflows for imminent expiry, inverted Leaf -> Intermediate chains, weak keys, and RFC 6125 SAN mismatches:
name: X.509 Certificate Chain & Expiry Gate
on:
pull_request:
paths:
- 'certs/**'
- '**/*.pem'
- '**/*.crt'
schedule:
- cron: '15 3 * * 1'
permissions:
contents: read
jobs:
certguard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Audit repository public X.509 certificates
uses: z121245017-ai/certguard-mcp@v1
with:
paths: 'certs'
min-days-remaining: '30'
fail-on-expiring: 'true'Security & Privacy Guarantees
Zero Private Scalar Output:
verify_spki_key_and_csr_matchderives the publicSubjectPublicKeyInfodigest in memory and verifies RSA/EC mathematical self-consistency (2^(e*d) === 2 mod n/ curve scalar point match) while never returning private scalard, prime factorsp/q, or raw private key PEM/DER bytes.Zero External Dependencies & Zero Network Calls: Pure JavaScript ASN.1 DER/PEM decoder running locally on Node.js
>= 20.
Verification
npm testLicense
MIT License — 0 external npm dependencies, 0 network calls, 100% local deterministic execution.
Available Tools
4 toolsaudit_x509_pem_chainARead-onlyIdempotent
Decodes X.509 PEM or Base64 DER certificate bundles, detects scrambled Leaf -> Intermediate CA order, missing intermediates, weak SHA-1/<2048-bit RSA keys, and expiry countdowns.
Inputs: certPem, certPath, stripRoot, minDaysRemaining, +1 more.
check_hostname_rfc6125_sanARead-onlyIdempotent
Validates target hostnames and IPv4/IPv6 literals against X.509 SubjectAltName DNS/IP entries per RFC 6125, catching bare-apex *.example.com and multi-level wildcard traps.
Inputs: certPem, certPath, hostname, hostnames.
extract_cert_serial_and_spki_pinsARead-onlyIdempotent
Extracts uppercase contiguous Hex serial numbers (for WeChat Pay v3 serial_no and mTLS gateways), SHA-256 certificate thumbprints, and Base64 SHA-256 SPKI pins.
Inputs: certPem, certPath, includeChain.
verify_spki_key_and_csr_matchARead-onlyIdempotent
Verifies mathematical SubjectPublicKeyInfo (SPKI) match across Certificate, PKCS#10 CSR, and PKCS#8/PKCS#1/SEC1 Private Key locally without exposing private key scalars.
Inputs: csrPem, keyPem, certPem, csrPath, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct, non-overlapping check: chain ordering/strength audit, SPKI-to-CSR-to-key matching, RFC 6125 hostname/SAN validation, and serial/thumbprint/pin extraction. There is no plausible scenario where an agent would confuse one for another.
All four tools follow a consistent verb_noun snake_case pattern (audit_, verify_, check_, extract_) with descriptive domain qualifiers. Names are long and packed with qualifiers, but the convention is uniform and readable.
Four tightly scoped tools fit a focused certificate-validation server and each earns its place. It is on the lean side, but nothing is redundant or filler.
The surface covers chain inspection, key/CSR matching, hostname validation, and pin extraction, but has notable gaps for a cert-guard domain: no revocation checking (OCSP/CRL), no chain signature/trust-anchor verification, and no self-signed or expiry-only summary tool. Agents can work around some of this externally, but revocation is a real dead end.
Maintenance
Related MCP Connectors
Experimental MCP server for current empirical verification of explicit public HTTPS endpoint claims.
MCP compatibility and transport verification server.
MCP compatibility and transport verification server.
MCP compatibility and transport verification server.
Related MCP Servers
AlicenseAqualityCmaintenanceA local MCP server for AI-assisted PKI and ASN.1 workflows, providing tools for certificate parsing, key management, and PKCS#12 processing.2849 npmMIT- AlicenseNot gradedqualityCmaintenanceFree SSL/TLS scanning and Let's Encrypt certificate issuance (private key stays local), plus certificate-expiry monitoring via one MCP server. Public scan and cert tools need no account.3MIT
- AlicenseAqualityCmaintenanceA domain security and privacy checker MCP server that runs locally, performing DNS, TLS, HTTP, and RDAP lookups to generate a scored report covering certificates, email authentication, DNS, and web security headers.3307 npmGPL 3.0
- AlicenseNot gradedqualityBmaintenanceMCP server for Technical SEO DNS record auditing, SOA expiry health checks, SSL/TLS inspection, and HTTP security header analysis. Enables comprehensive security audits and scoring via 10 tools.MIT