Fetches and updates CVE (Common Vulnerabilities and Exposures) data from the GitHub CVEProject/cvelistV5 repository, enabling access to vulnerability information through natural language queries against a local database.
CVE MCP Server (Prototype)
A local, containerized Model Context Protocol (MCP) server that provides conversational access to a CVE (Common Vulnerabilities and Exposures) database.
PROTOTYPE: This is a project demonstrating MCP server implementation. It is functional but not production-ready.
Overview
This project enables natural-language queries against a local CVE database using any MCP-compatible client. All data is stored locally for privacy and can be refreshed from public CVE sources.
Features
Fully local - all data on your machine, stdio transport only
Refreshable CVE data from GitHub database
Runs in Docker
Works with MCP Inspector and other MCP clients
Three tools:
get_cve_details,search_cves,get_statistics
Prerequisites
Docker (with
docker composesupport)Python 3.11+ (for local development)
Node.js 18+ (for MCP Inspector)
Installation
Project uses pyproject.toml for configuration.
Configuration (optional)
Create a .env file to customize paths:
Works fine without any configuration.
Quick Start with Run Scripts (Recommended)
Convenient shell scripts automate the testing workflow:
Docker Testing (Full Workflow)
Local Testing (Full Workflow)
Available Run Scripts
Script | Purpose | Usage |
| Load small dataset via API |
|
| Load full/filtered dataset via Git |
|
| Build and start Docker container |
|
| Launch MCP Inspector for testing |
|
Quick Start with Docker (Manual)
1. Clone the Repository
2. Build Docker Image
3. Load CVE Data
This downloads ~100 recent CVEs from GitHub (takes 1-2 minutes).
4. Start Container
Verify it's running:
5. Test with MCP Inspector
Inspector configuration:
Command:
dockerArguments:
exec -i cve-mcp-server python -m src.mcp_serverEnvironment:
PYTHONPATH=/app
Local Development (Without Docker)
1. Setup Python Environment
2. Load CVE Data
3. Run MCP Server
The server will wait for MCP client connections via stdio.
4. Test Locally with MCP Inspector
In a new terminal:
Configuration:
Command:
pythonArguments:
-m src.mcp_serverEnvironment:
PYTHONPATH=/path/to/cve-mcp-server
5. Run Unit Tests
Available Tools
get_cve_details
Get detailed information about a specific CVE.
Parameters:
cve_id(string): CVE identifier like "CVE-2024-0001"
Example:
Response:
search_cves
Search CVEs by keyword.
Parameters:
keyword(string): Search termlimit(integer): Max results, default 10
Example response:
get_statistics
Get database stats.
No parameters.
Data Management
Using Run Scripts (Recommended)
Local development:
Docker:
Manual Commands
Load More CVE Data (Local):
Load More CVE Data (Docker):
Performance & Benchmarks
Based on systematic benchmarking:
Full dataset load time: ~6-7 minutes (240,000 CVEs)
Database size: ~190 MB
Loading speed: 2,700+ CVEs/second (using optimized loader)
Load Full Dataset
See benchmarks/BENCHMARK_RESULTS.md for detailed analysis.
Check Database Status
Project Structure
Technologies Used
Python 3.11: Core language
MCP SDK: Model Context Protocol implementation
SQLite: Local database with full-text search capability
Docker: Containerization and deployment
GitHub CVE Database: Data source (CVEProject/cvelistV5)
pyproject.toml: Modern Python project configuration (PEP 621)
Testing
Quick Testing with Run Script (Recommended)
Use the convenient testing script that handles both local and Docker deployments:
The script will:
Ask if you want to test Local or Docker deployment
Validate prerequisites (virtual environment, container running, database exists)
Display the correct MCP Inspector configuration
Launch MCP Inspector automatically
Manual Testing with MCP Inspector
MCP Inspector provides an interactive UI to test all tools:
Start the server (Docker or local)
Run
npx @modelcontextprotocol/inspectorConfigure connection (see Quick Start sections above)
Test each tool with various inputs
For detailed testing procedures, see TESTING.md.
Unit Testing
Troubleshooting
Docker Issues
Container won't start:
No CVE data loaded:
Rebuild after code changes:
MCP Inspector Connection Issues
Connection fails:
Verify container is running:
docker psCheck exact command:
docker exec -i cve-mcp-server python -m src.mcp_serverEnsure container name matches:
cve-mcp-server
Tools not appearing:
Check server logs for import errors
Verify PYTHONPATH is set correctly
Local Development Issues
Import errors:
Ensure virtual environment is activated
Check PYTHONPATH includes project root
Verify all dependencies installed:
pip install -r requirements.txt
Database not found:
Check
data/cve.dbexistsRun data loader:
python -m src.data_ingestion.loader
Limitations
Local only (stdio transport)
Basic keyword search, no FTS5 yet
Manual data refresh
No auth/security (local use only)
TODO
Things that would be nice to add:
SSE transport for network access
SQLite FTS5 for better search
Filter by CVSS score/severity/date ranges
Automated data refresh (cron job?)
Example UI with Streamlit or something
Maybe a REST API wrapper
CVE monitoring/alerts
Export to PDF/CSV
Stats dashboard
Contributing
Prototype project. PRs welcome for bug fixes, docs, or features from TODO list.
License
MIT - see LICENSE file
Credits
CVE data from CVEProject/cvelistV5
Built with Anthropic MCP SDK
Note: This is a prototype. For production use you'd want proper security, auth, error handling, etc.