Provides real-time OWASP ASVS security guidance, vulnerability scanning, and secure code fixes for AI coding agents during code generation
VSGuard MCP - Vulnerability Scanner & Guard
A production-ready Model Context Protocol (MCP) server that provides real-time OWASP ASVS security guidance and vulnerability scanning for AI coding agents.
VSGuard = Vulnerability Scanner + Guard - Powered by FastMCP 2.0
๐ฏ Overview
This MCP server integrates with Claude Desktop, Cursor, and other MCP-compatible tools to enable proactive security during code generation. It helps AI agents write secure code from the start by providing:
๐ OWASP ASVS Requirements - Real-time security guidance based on ASVS v4.0
๐ Vulnerability Scanning - Static analysis using Semgrep with custom ASVS rules
๐ ๏ธ Secure Code Fixes - Actionable remediation with code examples
๐ค LLM-Optimized Output - Formatted for maximum comprehension by AI agents
โจ Features
Three Core Tools
check_security_requirements
- Get relevant ASVS requirements before writing codescan_code
- Analyze code for vulnerabilities with ASVS mappingssuggest_fix
- Generate secure code alternatives with explanations
Security Coverage
โ Authentication (ASVS Chapter 2)
โ Session Management (ASVS Chapter 3)
โ Access Control (ASVS Chapter 4)
โ Input Validation & Injection Prevention (ASVS Chapter 5)
โ Cryptography (ASVS Chapters 6-9)
โ Data Protection
Supported Languages
Python (primary)
JavaScript/TypeScript
Java, Go, Ruby, PHP, C/C++, C#, Rust (via Semgrep)
๐ Quick Start
Prerequisites
Python 3.11+
pip or Poetry
Semgrep (for scanning)
Installation
Running the Server
Configure Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
:
Or with Poetry:
Or use FastMCP CLI (simplest):
Restart Claude Desktop to load the server.
๐ Usage Examples
Example 1: Get Security Requirements
In Claude Desktop:
Claude will call:
Response:
[... more requirements ...]
Can you check this code for security issues?
def login(username, password): query = f"SELECT * FROM users WHERE username = '{username}'" cursor.execute(query)
Response:
Remediation: Use parameterized queries with placeholders instead of string concatenation.
Example:
How do I fix this SQL injection vulnerability?
Response:
โ Secure Code
๐ Explanation
Use parameterized queries (prepared statements) instead of string concatenation.
๐ก๏ธ Security Benefits
Prevents SQL injection attacks
Separates code from data
vsguard-mcp/ โโโ src/ โ โโโ server.py # MCP server entry point โ โโโ config.py # Configuration โ โโโ models.py # Pydantic data models โ โ โ โโโ asvs/ โ โ โโโ loader.py # Load ASVS from YAML โ โ โโโ mapper.py # Map findings to ASVS โ โ โโโ requirements.py # Requirement models โ โ โ โโโ scanners/ โ โ โโโ base.py # Abstract scanner โ โ โโโ semgrep_scanner.py # Semgrep integration โ โ โ โโโ fixes/ โ โ โโโ generator.py # Fix generator โ โ โโโ templates.py # Fix templates โ โ โ โโโ utils/ โ โโโ formatters.py # LLM-optimized formatting โ โโโ data/ โ โโโ asvs/ # ASVS requirements (YAML) โ โ โโโ authentication.yaml โ โ โโโ session_management.yaml โ โ โโโ validation.yaml โ โ โโโ cryptography.yaml โ โ โ โโโ rules/ # Custom Semgrep rules โ โโโ authentication.yaml โ โโโ injection.yaml โ โโโ cryptography.yaml โ โโโ session.yaml โ โโโ tests/ # Test suite
๐งช Testing
๐ Coverage
Current implementation includes:
40+ ASVS Requirements across authentication, session management, input validation, and cryptography
25+ Custom Semgrep Rules detecting common vulnerabilities
10+ Fix Templates with secure code examples
Multiple Languages supported (Python, JavaScript, TypeScript, etc.)
Vulnerability Detection
SQL Injection (ASVS 5.3.4, 5.3.5)
Cross-Site Scripting (ASVS 5.3.3, 5.3.10)
Weak Password Validation (ASVS 2.1.1, 2.1.7)
Weak Cryptography (ASVS 6.2.2, 6.2.5)
Hardcoded Secrets (ASVS 2.3.1, 14.3.3)
Session Management Issues (ASVS 3.x)
XML External Entity (XXE) (ASVS 5.5.2)
Command Injection (ASVS 5.3.4)
And more...
๐ How It Works
1. ASVS Requirements Database
The server loads OWASP ASVS v4.0 requirements from structured YAML files:
2. Static Analysis with Semgrep
Custom Semgrep rules detect ASVS violations:
3. Intelligent Mapping
Findings are automatically mapped to ASVS requirements by:
Vulnerability type (sql_injection โ ASVS 5.3.4)
CWE ID (CWE-89 โ ASVS 5.3.4, 5.3.5)
Code patterns (login endpoints โ authentication requirements)
4. LLM-Optimized Output
All responses are formatted for maximum LLM comprehension:
Clear structure with headers and sections
Code examples with syntax highlighting
Severity indicators (๐ด ๐ ๐ก)
Actionable remediation steps
ASVS requirement references
๐ง Extending the Server
Add New ASVS Requirements
Create/edit YAML files in data/asvs/
:
Add Custom Semgrep Rules
Create YAML files in data/rules/
:
Add Fix Templates
Edit src/fixes/templates.py
:
๐ค Contributing
Contributions welcome! Areas for improvement:
More ASVS Requirements - Cover additional chapters
More Languages - Expand language support
More Scanners - Integrate Bandit, detect-secrets
Better AI Integration - Improve LLM output formatting
Performance - Optimize scanning speed
โก Powered By
FastMCP 2.0 - Modern Python framework for MCP servers
Semgrep - Static analysis engine
OWASP ASVS - Security verification standard
๐ License
MIT License - see LICENSE file for details.
๐ Resources
๐ Acknowledgments
OWASP for the ASVS standard
Anthropic for the MCP protocol
Semgrep for the scanning engine
๐ง Support
For issues, questions, or contributions, please open an issue on GitHub.
Built with โค๏ธ for secure AI-assisted development
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Provides real-time OWASP ASVS security guidance and vulnerability scanning for AI coding agents. Enables proactive security during code generation by checking security requirements, scanning code for vulnerabilities, and suggesting secure code fixes.