Cyber-Agents-Fleet/CVE-MCP-Server
If you are the rightful owner of CVE-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The CVE-MCP Server is a Model Context Protocol server designed to integrate AI agents with CVE databases for enhanced threat intelligence and vulnerability assessment.
š”ļø CVE-MCP Server
Model Context Protocol Server for CVE Database Integration
A production-ready MCP server that provides AI agents with seamless access to Common Vulnerabilities and Exposures (CVE) databases, enabling automated threat intelligence gathering and vulnerability assessment workflows.
šÆ Overview
The CVE-MCP server bridges the gap between AI agents and vulnerability databases, providing standardized access to:
- National Vulnerability Database (NVD)
- MITRE CVE Database
- GitHub Security Advisories
- Exploit Database correlations
- CVSS scoring and impact analysis
⨠Features
š CVE Query Capabilities
- Search by CVE ID, CVSS score, vendor, product
- Date range filtering and severity classification
- Advanced search with multiple criteria
- Real-time vulnerability feeds
š Threat Intelligence
- CVSS v3.1/v4.0 scoring integration
- Exploit availability detection
- Patch status and remediation guidance
- Impact assessment and risk scoring
š Data Source Integration
- NVD API v2.0 with rate limiting
- MITRE CVE JSON feeds
- GitHub Security Advisory API
- ExploitDB cross-referencing
- Custom vulnerability feeds
š¤ AI Agent Integration
- Structured data output for LLM consumption
- Context-aware vulnerability summaries
- Automated risk assessment reports
- Integration with penetration testing workflows
š Quick Start
Prerequisites
# Python 3.9+
python --version
# Install dependencies
pip install -r requirements.txt
Installation
# Clone the repository
git clone https://github.com/Cyber-Agents-Fleet/CVE-MCP.git
cd CVE-MCP
# Install in development mode
pip install -e .
# Configure environment
cp .env.example .env
# Edit .env with your API keys
Basic Usage
# Start the MCP server
python -m cve_mcp.server
# Test with sample queries
python scripts/test_queries.py
š API Reference
Core MCP Tools
search_cve
Search CVE database with flexible criteria
{
"name": "search_cve",
"arguments": {
"cve_id": "CVE-2024-1234",
"severity": "HIGH",
"vendor": "microsoft",
"product": "windows",
"limit": 50
}
}
get_cve_details
Retrieve comprehensive CVE information
{
"name": "get_cve_details",
"arguments": {
"cve_id": "CVE-2024-1234",
"include_exploits": true,
"include_references": true
}
}
vulnerability_feed
Get latest vulnerabilities by criteria
{
"name": "vulnerability_feed",
"arguments": {
"days": 7,
"severity_min": "MEDIUM",
"with_exploits": true
}
}
risk_assessment
Generate AI-friendly risk analysis
{
"name": "risk_assessment",
"arguments": {
"cve_list": ["CVE-2024-1234", "CVE-2024-5678"],
"environment": "enterprise",
"include_mitigations": true
}
}
šļø Repository Structure
CVE-MCP/
āāā src/
ā āāā cve_mcp/
ā āāā __init__.py
ā āāā server.py # Main MCP server
ā āāā handlers/
ā ā āāā __init__.py
ā ā āāā cve_search.py # CVE search handlers
ā ā āāā nvd_client.py # NVD API client
ā ā āāā mitre_client.py # MITRE integration
ā ā āāā exploit_db.py # Exploit database
ā āāā models/
ā ā āāā __init__.py
ā ā āāā cve.py # CVE data models
ā ā āāā vulnerability.py # Vulnerability schemas
ā āāā utils/
ā āāā __init__.py
ā āāā cvss.py # CVSS calculations
ā āāā cache.py # Caching utilities
ā āāā rate_limiter.py # API rate limiting
āāā tests/
ā āāā __init__.py
ā āāā test_server.py
ā āāā test_handlers.py
ā āāā fixtures/
āāā scripts/
ā āāā setup_database.py
ā āāā test_queries.py
ā āāā data_sync.py
āāā docs/
ā āāā API.md
ā āāā DEPLOYMENT.md
ā āāā CONFIGURATION.md
ā āāā EXAMPLES.md
āāā docker/
ā āāā Dockerfile
ā āāā docker-compose.yml
āāā .env.example
āāā .gitignore
āāā requirements.txt
āāā setup.py
āāā pyproject.toml
āāā README.md
āļø Configuration
Environment Variables
# API Keys
NVD_API_KEY=your_nvd_api_key
GITHUB_TOKEN=your_github_token
# Database
DATABASE_URL=sqlite:///cve_cache.db
REDIS_URL=redis://localhost:6379
# Rate Limiting
NVD_REQUESTS_PER_SECOND=0.5
GITHUB_REQUESTS_PER_HOUR=5000
# Caching
CACHE_TTL=3600
ENABLE_CACHE=true
Data Sources Configuration
# config/sources.yml
data_sources:
nvd:
enabled: true
api_version: "2.0"
base_url: "https://services.nvd.nist.gov/rest/json/cves/2.0"
mitre:
enabled: true
feed_url: "https://cve.mitre.org/data/downloads/allitems.csv"
github:
enabled: true
api_url: "https://api.github.com/advisories"
exploitdb:
enabled: true
csv_url: "https://gitlab.com/exploit-database/exploitdb/-/raw/main/files_exploits.csv"
š§ Development
Setting up Development Environment
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -r requirements-dev.txt
# Install pre-commit hooks
pre-commit install
# Run tests
pytest tests/ -v
# Run with coverage
pytest --cov=cve_mcp tests/
Running Tests
# Unit tests
pytest tests/unit/
# Integration tests
pytest tests/integration/
# Performance tests
pytest tests/performance/
š³ Docker Deployment
Quick Start with Docker
# Build and run
docker-compose up -d
# View logs
docker-compose logs -f cve-mcp
# Scale for high availability
docker-compose up -d --scale cve-mcp=3
Production Deployment
# Production build
docker build -f docker/Dockerfile.prod -t cve-mcp:prod .
# Deploy with orchestration
kubectl apply -f k8s/
š Usage Examples
Integration with AI Agents
from mcp import ClientSession
from cve_mcp.client import CVEMCPClient
# Connect to CVE-MCP server
client = CVEMCPClient("http://localhost:8000")
# Search for recent high-severity CVEs
recent_cves = await client.vulnerability_feed(
days=30,
severity_min="HIGH",
with_exploits=True
)
# Generate risk assessment for AI agent
risk_report = await client.risk_assessment(
cve_list=[cve["id"] for cve in recent_cves],
environment="enterprise",
include_mitigations=True
)
Penetration Testing Workflow
# Find vulnerabilities for specific target
target_cves = await client.search_cve(
vendor="microsoft",
product="exchange",
severity="CRITICAL"
)
# Check for available exploits
exploitable = [
cve for cve in target_cves
if cve.get("exploit_available")
]
š Security Considerations
- API Key Management: Secure storage of API credentials
- Rate Limiting: Respect upstream API limits
- Data Validation: Input sanitization and validation
- Access Control: Authentication for production deployments
- Audit Logging: Comprehensive request/response logging
š License
This project is licensed under the MIT License - see the file for details.
š¤ Contributing
Please read for details on our code of conduct and the process for submitting pull requests.
š Support
- Email: support@popdocs.net
- Documentation: https://www.popdocs.net/
- Issues: GitHub Issues
ā ļø Disclaimer
This tool is designed for authorized security testing and research purposes only. Users are responsible for compliance with applicable laws and regulations.
CVE-MCP Server - Empowering AI Agents with Vulnerability Intelligence