web-security-guard
Generates Content-Security-Policy and security hardening configurations for Apache web servers, including .htaccess files.
Generates Content-Security-Policy and security header configurations for Cloudflare Workers deployments.
Generates Content-Security-Policy and security header configurations for Express.js applications, including Helmet integration.
Generates Content-Security-Policy and security header configurations for Netlify, producing _headers and netlify.toml files.
Generates Level 3 Content-Security-Policy configurations for Next.js 14/15 App Router using middleware.ts and cryptographic nonces.
Generates Content-Security-Policy and security hardening configurations for Nginx, including TLS 1.3, rate-limiting, and security headers.
Generates Content-Security-Policy and security header configurations for Vercel deployments via vercel.json.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@web-security-guardaudit https://example.com for missing security headers and suggest fixes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π‘οΈ Web Security Guard
π Overview
Web Security Guard (web-security-guard) is a zero-dependency, high-performance security automation suite and interactive Google Material 3 Security Studio. Built for developers, DevOps engineers, and autonomous AI coding agents, it eliminates the complexity of securing modern web applications against Cross-Site Scripting (XSS), Clickjacking, MIME confusion, and supply chain tampering.
βββββββββββββββββββββββββββββββββββββββββββββββββ
β Google Security Studio UI β
β Material 3 Light Mode β’ 0-100 Grade Gauge β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
βββββββββββββββββββββ¬ββββββββββββββ΄ββββββββ¬ββββββββββββββββββββ
βΌ βΌ βΌ βΌ
βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ
β Live Auditor β β CSP Level 3 β β SRI Engine β β WCAG 2.2 β
β Headers & SSR β β Nonces & Next β β Hashes & Tag β β Color Contrastβ
β 10+ Vectors β β Multi-Platformβ β Auto-Inject β β CB Simulation β
βββββββββ¬ββββββββ βββββββββ¬ββββββββ βββββββββ¬ββββββββ βββββββββ¬ββββββββ
β β β β
βββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββ
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββ
β Model Context Protocol (MCP) Hub β
β Claude Desktop β’ Cursor β’ Cline β’ Zed β’ CLI β
βββββββββββββββββββββββββββββββββββββββββββββββββRelated MCP server: Sekrd Security Scanner
π Key Features
1. π‘οΈ Multi-Vector Security Header Auditor
Audits live websites or response headers against OWASP Top 10 and Google Web Security guidelines.
Computes an animated 0β100 Security Grade Gauge ($A+, A, B, C, D, F$).
Evaluates:
Strict-Transport-Security(HSTS duration, subdomains, preloading).Content-Security-PolicyLevel 3.X-Frame-Options& CSPframe-ancestors.X-Content-Type-Options: nosniff.Referrer-Policy,Permissions-Policy,COOP,COEP,CORP.RFC 6265bis Cookie Hardening (
Secure,HttpOnly,SameSite,__Host-prefixes).Information Leakage detection (
Server,X-Powered-By).
2. π CSP Level 3 Policy Builder & Framework Exporter
Interactive synthesis of modern
'strict-dynamic'policies with per-request cryptographic nonces.Eliminates vulnerable domain allowlists.
Generates 1-click drop-in configurations for:
Next.js 14/15 App Router (
middleware.ts)Nginx (
nginx.conf)Vercel (
vercel.json)Netlify (
_headersandnetlify.toml)Cloudflare Workers
Apache (
.htaccess)Express.js (
helmet)
3. 𧬠Subresource Integrity (SRI) Hasher & HTML Injector
Computes SHA-256, SHA-384, and SHA-512 base64 digests for local files or remote CDN bundles.
Automated HTML Batch Injector parses raw HTML and inserts
integrityandcrossorigin="anonymous"tags to protect against supply-chain attacks.
4. π¨ WCAG 2.2 Color Contrast & Color Blindness Simulator
Exact relative luminance ($L = 0.2126 R + 0.7152 G + 0.0722 B$) calculation.
Live compliance validation for WCAG AA Normal (4.5:1), AA Large (3:1), UI Components (3:1), and AAA Normal (7:1).
Integrated matrix transformation simulation for Protanopia, Deuteranopia, Tritanopia, and Achromatopsia.
5. π€ AI Agent Model Context Protocol (MCP) Hub
Out-of-the-box MCP server compatible with Claude Desktop, Cursor AI, Cline, Roo Code, and Zed Editor.
Equips LLM agents with tools:
audit_url,generate_csp,calculate_sri,calculate_contrast, andremediate_headers.
6. β‘ Multi-Platform Hardening Exporter
1-click
.zipbundle export containing pre-configured security files for your entire infrastructure stack.
π¦ Installation & Quickstart
Option A: Run via uvx (Zero Install)
# Start the Google Security Studio UI
uvx web-security-guard serve --port 8080 --open
# Audit a live URL directly from CLI
uvx web-security-guard audit https://example.comOption B: Install via pip
pip install web-security-guardπ» CLI Usage
# 1. Audit a live website with interactive report
web-sec-guard audit https://google.com
# 2. Audit and output machine-readable JSON
web-sec-guard audit https://example.com --format json
# 3. Generate Level 3 CSP for Next.js App Router
web-sec-guard csp --preset strict_nonce --export nextjs
# 4. Compute Subresource Integrity for CDN script
web-sec-guard sri https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js
# 5. Check WCAG 2.2 Color Contrast
web-sec-guard contrast --fg "#1a73e8" --bg "#ffffff"
# 6. Launch Google Security Studio Web UI
web-sec-guard serve --host 127.0.0.1 --port 8080 --openπ Python SDK
from web_security_guard import (
SecurityAuditEngine,
CSPBuilderEngine,
SRIEngine,
WCAGContrastEngine,
)
# 1. Run live audit
audit = SecurityAuditEngine.fetch_and_audit("https://example.com")
print(f"Grade: {audit['grade']} (Score: {audit['score']}/100)")
# 2. Build CSP Level 3 policy
csp_data = CSPBuilderEngine.generate({"preset": "strict_nonce"})
print("Next.js Middleware:\n", csp_data["frameworks"]["nextjs"])
# 3. Compute SRI hash
sri = SRIEngine.hash_content_or_url(url="https://cdn.example.com/app.js")
print("SRI Tag:", sri["script_tag"])
# 4. Evaluate WCAG 2.2 Contrast
contrast = WCAGContrastEngine.evaluate("#1a73e8", "#ffffff")
print(f"Ratio: {contrast['ratio_formatted']} | AA: {contrast['wcag_aa_normal']}")π€ MCP Client Configuration for AI Agents
Add web-security-guard to your AI editor or Claude Desktop config:
{
"mcpServers": {
"web-security-guard": {
"command": "uvx",
"args": ["web-security-guard", "mcp"]
}
}
}Detailed guides for Cursor, Cline, Zed, and Claude Desktop are available in docs/MCP_GUIDE.md.
π Documentation & Reference Examples
π CSP Level 3 Best Practices: Deep dive into
'strict-dynamic', nonces, and bypassing allowlist pitfalls.π Multi-Platform Deployment Matrix: Framework configurations for Next.js, Vercel, Netlify, Nginx, Cloudflare, Express, and Apache.
π€ MCP Integration Guide: Complete tool signatures and prompt scenarios for LLM agents.
π Production Reference Examples:
nextjs-app-router/: Next.js 14/15 edge middleware with crypto nonces.vercel-headers/: Hardenedvercel.json.netlify-headers/: Production_headersandnetlify.toml.nginx-hardening/: TLS 1.3, rate-limiting, and security headersnginx.conf.cdn-sri-html/: HTML5 document with SHA-384 Subresource Integrity.mcp-clients/: Agent configs for Claude, Cursor, Cline, and Zed.
π§ͺ Testing & CI
# Run unit tests with pytest
PYTHONPATH=src pytest tests/ -vAll 15 GitHub Actions test matrix jobs run on Python 3.9 through 3.13 on Ubuntu, macOS, and Windows.
π License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Scan URLs for WCAG 2.1 violations, generate AI fixes, and produce VPAT 2.5 compliance reports.
Scan any public site for AI-agent visibility; get scored findings, a machine-readable fix pack, and
AI website audit: security, SEO, performance, UX and accessibility checks with actionable fixes.
Rule-based site audits: accessibility, SEO, security headers, performance. Metered per call.
Related MCP Servers
- AlicenseAqualityDmaintenanceA comprehensive suite of HTTP and API testing tools that enables AI agents to perform requests, check endpoint health, and decode JWTs. It also provides utilities for URL parsing and detailed security analysis of HTTP response headers.530 npmMIT

Sekrd Security Scannerofficial
FlicenseAqualityDmaintenanceEnables deep security auditing of web applications directly from AI IDEs including Cursor and Claude Code. Scans URLs for vulnerabilities, returns security scores with SHIP/BLOCK verdicts, and provides specific fix prompts for remediation.3-- AlicenseAqualityDmaintenanceEnables AI agents to perform comprehensive web accessibility checks (WCAG 2.1/2.2) including color contrast analysis, ARIA validation, and full accessibility report generation without requiring any API key.8MIT
- FlicenseNot gradedqualityDmaintenanceAnalyze and score HTTP security headers (CSP, HSTS, CORS, cookies) with actionable fix recommendations for web applications.-