Professional Security Scanner for Model Context Protocol Servers
The first open-source security scanner specifically designed for MCP servers
Quick Start β’ Features β’ Documentation β’ Examples β’ Contributing
MCP Guard is a comprehensive security assessment tool that identifies vulnerabilities in Model Context Protocol (MCP) servers through static analysis, dynamic testing, and intelligent fuzzing. Built for security professionals and developers working with AI systems.
- First-of-its-kind: Purpose-built for MCP server security assessment
- Universal Support: Works with Python, Node.js, Go, and Docker-based MCP servers
- Professional Scoring: Implements both CVSS v4.0 and AIVSS (AI Vulnerability Scoring System)
- Production Ready: Enterprise-grade features with comprehensive reporting
# Clone and setup
git clone https://github.com/SaravanaGuhan/mcp-guard.git
cd mcp-guard
pip install -r requirements.txt
# Scan an MCP server
python mcp_scanner.py https://github.com/openbnb-org/mcp-server-airbnb
That's it! MCP Guard will automatically detect the server type, perform comprehensive security analysis, and provide detailed vulnerability reports.
|
|
MCP Guard identifies security issues across multiple categories:
Category | Examples | Severity Range |
---|---|---|
MCP Protocol | Command injection, path traversal, auth bypass | Critical - Medium |
Input Validation | Parameter tampering, injection attacks | High - Medium |
Configuration | Insecure defaults, exposed secrets | Medium - Low |
Dependencies | Known CVEs, outdated packages | Critical - Info |
Code Quality | Hardcoded credentials, unsafe functions | High - Low |
================================================================================
MCP GUARD SECURITY ASSESSMENT REPORT
================================================================================
Target: https://github.com/openbnb-org/mcp-server-airbnb
Server Type: Node.js MCP Server
Scan Duration: 45.2 seconds
VULNERABILITY SUMMARY
βββ Total Issues: 5
βββ Critical: 1 High: 2 Medium: 1 Low: 1
βββ CVSS v4.0 Average: 6.8
βββ Overall Risk: HIGH
CRITICAL SEVERITY FINDINGS
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β [CVE-2024-XXXX] Command Injection in Tool Handler
β CVSS Score: 9.1 (CRITICAL) | AIVSS Score: 8.7 (AI_HIGH)
β File: src/tools/system.js:45
β
β Description: Unsanitized user input passed to child_process.exec()
β Impact: Remote code execution on server
β Remediation: Implement input validation and use parameterized commands
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
RECOMMENDATIONS
β’ Implement comprehensive input validation for all MCP tool parameters
β’ Update 3 vulnerable dependencies (express, lodash, axios)
β’ Enable security headers and HTTPS enforcement
β’ Add rate limiting to prevent abuse
Scan completed successfully β
- Python 3.8 or higher
- Internet connection for repository downloads
- Git (optional, for development)
git clone https://github.com/SaravanaGuhan/mcp-guard.git
cd mcp-guard
pip install -r requirements.txt
git clone https://github.com/SaravanaGuhan/mcp-guard.git
cd mcp-guard
pip install -e .
pip install -r requirements-dev.txt
docker build -t mcp-guard .
docker run -v $(pwd):/workspace mcp-guard https://github.com/target/mcp-server
# Scan a GitHub repository
python mcp_scanner.py https://github.com/cloudflare/mcp-server-cloudflare
# Static analysis only
python mcp_scanner.py --scan-type static https://github.com/target/repo
# Dynamic analysis only
python mcp_scanner.py --scan-type dynamic https://github.com/target/repo
# Output to JSON
python mcp_scanner.py --output report.json https://github.com/target/repo
from mcp_scanner import UniversalMCPScanner
scanner = UniversalMCPScanner()
results = scanner.scan_mcp_server(
repo_url="https://github.com/target/mcp-server",
scan_type="both"
)
print(f"Found {len(results['vulnerabilities'])} vulnerabilities")
print(f"Overall risk: {results['summary']['risk_assessment']['overall_risk']}")
MCP Guard has been tested with popular MCP server implementations:
Server | Language | Status | Vulnerabilities Found |
---|---|---|---|
Airbnb MCP Server | Node.js | β Tested | 5 issues identified |
Cloudflare MCP Server | Node.js | β Tested | 3 issues identified |
GitHub MCP Server | Go | β Tested | 2 issues identified |
PostgreSQL MCP Server | Python | β Tested | 4 issues identified |
Docker MCP Server | Go | β Tested | 1 issue identified |
graph TB
A[Repository URL] --> B[Repository Handler]
B --> C[Server Type Detection]
C --> D[Static Analysis Engine]
C --> E[Dynamic Analysis Engine]
D --> F[Vulnerability Scoring]
E --> F
F --> G[CVSS v4.0 Scoring]
F --> H[AIVSS Scoring]
G --> I[Report Generation]
H --> I
I --> J[JSON/Console Output]
- Repository Handler: Downloads and analyzes repository structure
- Static Analysis Engine: Pattern-based vulnerability detection
- Dynamic Analysis Engine: Live server testing and fuzzing
- Vulnerability Scoring: CVSS v4.0 and AIVSS implementation
- Report Generator: Professional vulnerability reporting
Document | Description |
---|---|
Complete Setup Guide | Comprehensive installation and configuration |
Quick Start Guide | Get started in 3 minutes |
Contributing Guide | How to contribute to the project |
Project Summary | Detailed project overview |
We welcome contributions from the security and AI communities!
- Report Bugs: Found an issue? Open a bug report
- Feature Requests: Have an idea? Request a feature
- Code Contributions: Submit pull requests for improvements
- Documentation: Help improve our documentation
- Testing: Test with new MCP servers and report results
git clone https://github.com/SaravanaGuhan/mcp-guard.git
cd mcp-guard
pip install -e ".[dev]"
pytest tests/
MCP Guard is designed with security in mind:
- Safe Repository Handling: Secure download and cleanup processes
- Sandboxed Execution: Isolated dynamic analysis environment
- Input Validation: Protection against malicious repository content
- Resource Limits: CPU, memory, and time constraints
- Network Security: HTTPS-only downloads with timeout protection
This project is licensed under the MIT License - see the LICENSE file for details.
- MCP Community: For developing the Model Context Protocol
- Security Researchers: For vulnerability research and best practices
- Open Source Contributors: For making this project possible
- CVSS Working Group: For the CVSS v4.0 specification
Built with β€οΈ for the MCP and Security Communities
β Star this repo β’ π Report Issues β’ π¬ Discussions