marklechner/mcp-kev
If you are the rightful owner of mcp-kev 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 KEV MCP Server is a locally hosted Model Context Protocol server designed for interacting with the CISA Known Exploited Vulnerabilities database, utilizing FastAPI, Python, and the official MCP SDK.
KEV MCP Server
A locally hosted MCP (Model Context Protocol) server for interacting with the CISA Known Exploited Vulnerabilities (KEV) database, built with FastAPI, Python, and the official MCP SDK.
Features
- FastMCP Implementation: Uses the official Python MCP SDK with FastMCP for clean, documented patterns
- Real-time KEV Data: Fetches from CISA's official KEV JSON feed (1,400+ vulnerabilities)
- Smart Caching: 1-hour cache expiry for optimal performance
- AI Analysis: Integration with Ollama for vulnerability analysis and security insights
- Flexible Search: Search by vendor, limit results, get detailed statistics
- UV Package Management: Modern Python dependency management
Quick Start
Prerequisites
Installation
- Clone the repository:
git clone <repository-url>
cd kev-mcp
- Install dependencies:
cd client
uv sync
Running the Demo
The easiest way to see the KEV MCP server in action:
python demo.py
This will run three demonstrations:
- Database Statistics - Overview of KEV data
- Vendor Search - Find Microsoft vulnerabilities
- AI Analysis - Ollama-powered security analysis
Manual Usage
Basic Commands
Get KEV database statistics:
cd client
uv run python kev_mcp_ai_client.py ../server/fastmcp_kev_server.py stats
Search for vulnerabilities by vendor:
cd client
uv run python kev_mcp_ai_client.py ../server/fastmcp_kev_server.py search Microsoft 5
AI-powered vulnerability analysis:
cd client
uv run python kev_mcp_ai_client.py ../server/fastmcp_kev_server.py ai-search Apple 3
Interactive Mode
For interactive exploration:
cd client
uv run python kev_mcp_ai_client.py ../server/fastmcp_kev_server.py
Available commands in interactive mode:
stats
- Get database statisticssearch [vendor] [limit]
- Search vulnerabilitiesai-search [vendor] [limit]
- Search with AI analysisquit
- Exit
Repository Structure
kev-mcp/
āāā README.md # This file
āāā demo.py # Interactive demonstration script
āāā server/
ā āāā fastmcp_kev_server.py # Main MCP server (FastMCP implementation)
āāā client/
āāā kev_mcp_ai_client.py # AI-enhanced MCP client
āāā pyproject.toml # Dependencies and configuration
āāā README.md # Client-specific documentation
Architecture
Server (server/fastmcp_kev_server.py
)
- FastMCP-based: Uses official MCP SDK patterns with decorators
- Two Tools:
get_kev_statistics()
: Database overview with ransomware stats and top vendorssearch_vulnerabilities(vendor, limit)
: Flexible vulnerability search
- Global Caching: 1-hour cache for CISA KEV data
- Type Hints: Automatic schema generation
Client (client/kev_mcp_ai_client.py
)
- MCP Communication: Official stdio transport patterns
- Ollama Integration: AI vulnerability analysis using local LLM
- Multiple Modes: Command-line arguments or interactive mode
- Error Handling: Comprehensive error handling and debugging
Key Use Cases
Security Teams
- Threat Intelligence: Stay updated on actively exploited vulnerabilities
- Risk Assessment: Understand which vendors have the most KEV entries
- Prioritization: Focus on vulnerabilities with known ransomware usage
DevSecOps
- CI/CD Integration: Query KEV data in automated security pipelines
- Vendor Risk: Assess third-party component risks
- Compliance: Track remediation of known exploited vulnerabilities
Security Researchers
- Trend Analysis: Study patterns in exploited vulnerabilities
- AI Insights: Get detailed security analysis and mitigation strategies
- Data Exploration: Interactive investigation of KEV database
Data Source
This server fetches data from the official CISA KEV catalog:
- URL: https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
- Update Frequency: CISA updates this regularly as new exploited vulnerabilities are discovered
- Cache Duration: Server caches data for 1 hour to balance freshness and performance
Development
The server follows official MCP documentation patterns exactly:
- Uses
@mcp.tool()
decorators for automatic schema generation - Implements proper stdio transport for client-server communication
- Type hints enable automatic parameter validation
- Global caching with configurable expiry
Requirements
- FastAPI: High-performance async web framework
- MCP SDK: Official Python MCP implementation
- UV: Modern Python package and dependency manager
- HTTPX: Async HTTP client for CISA API calls
- Ollama: Local LLM integration for AI analysis
License
This project demonstrates MCP server implementation for educational and security research purposes.