A Model Context Protocol (MCP) server for querying NIST National Vulnerability Database (NVD) API endpoints. This MCP server exposes tools to query the NVD/CVE REST API and return formatted text results suitable for LLM consumption via the MCP protocol. It includes automatic query chunking for large date ranges and parallel processing for improved performance. Base API docs: https://nvd.nist.gov/d
Add this skill
npx mdskills install HaroldFinchIFT/vuln-nist-mcp-serverComprehensive MCP server for NIST NVD queries with temporal awareness and parallel processing
1# vuln-nist-mcp-server23A Model Context Protocol (MCP) server for querying NIST National Vulnerability Database (NVD) API endpoints.45## Purpose67This MCP server exposes tools to query the NVD/CVE REST API and return formatted text results suitable for LLM consumption via the MCP protocol. It includes automatic query chunking for large date ranges and parallel processing for improved performance.89Base API docs: https://nvd.nist.gov/developers/vulnerabilities1011## Features1213### Available Tools1415- **`get_temporal_context`** - Get current date and temporal context for time-relative queries16 - Essential for queries like "this year", "last year", "6 months ago"17 - Provides current date mappings and examples for date parameter construction18 - **USAGE**: Call this tool FIRST when user asks time-relative questions1920- **`search_cves`** - Search CVE descriptions by keyword with flexible date filtering21 - Parameters: `keyword`, `resultsPerPage` (default: 20), `startIndex` (default: 0), `last_days` (`recent_days` has been deprecated), `start_date`, `end_date`22 - **New in v1.1.0**: Support for absolute date ranges with `start_date` and `end_date` parameters23 - **Date filtering priority**: `start_date`/`end_date` → `last_days` → default 30 days24 - Auto-chunks queries > 120 days into parallel requests25 - Results sorted by publication date (newest first)2627- **`get_cve_by_id`** - Retrieve detailed information for a specific CVE28 - Parameters: `cve_id`29 - Returns: CVE details, references, tags, and publication dates3031- **`cves_by_cpe`** - List CVEs associated with a Common Platform Enumeration (CPE)32 - Parameters: `cpe_name` (full CPE 2.3 format required), `is_vulnerable` (optional)33 - Validates CPE format before querying3435- **`kevs_between`** - Find CVEs added to CISA KEV catalog within a date range36 - Parameters: `kevStartDate`, `kevEndDate`, `resultsPerPage` (default: 20), `startIndex` (default: 0)37 - Auto-chunks queries > 90 days into parallel requests38 - Results sorted by publication date (newest first)3940- **`cve_change_history`** - Retrieve change history for CVEs41 - Parameters: `cve_id` OR (`changeStartDate` + `changeEndDate`), `resultsPerPage` (default: 20), `startIndex` (default: 0)42 - Auto-chunks date range queries > 120 days into parallel requests43 - Results sorted by change creation date (newest first)4445### Key Features4647- **Temporal Awareness**: New `get_temporal_context` tool for accurate time-relative queries48- **Flexible Date Filtering**: Support for both relative (`last_days`) and absolute (`start_date`/`end_date`) date ranges49- **Improved Result Ordering**: All results sorted chronologically (newest first) for better relevance50- **Parallel Processing**: Large date ranges are automatically split into chunks and processed concurrently51- **Input Validation**: CPE format validation, date parsing, parameter sanitization52- **Emoji Indicators**: Clear visual feedback (✅ success, ❌ error, ⚠️ warning, 🔍 search, 🔥 KEV, 🌐 CPE, 🕘 history, 📅 temporal)53- **Comprehensive Logging**: Detailed stderr logging for debugging54- **Error Handling**: Graceful handling of API errors, timeouts, and malformed responses5556## Prerequisites5758- Docker (recommended) or Python 3.11+59- Network access to NVD endpoints (`services.nvd.nist.gov`)60- MCP-compatible client (e.g., Claude Desktop)6162## Quick Start6364### Using Docker (Recommended)6566```bash67# Clone and build68git clone https://github.com/HaroldFinchIFT/vuln-nist-mcp-server69cd vuln-nist-mcp-server70docker build -t vuln-nist-mcp-server .7172# Run73docker run --rm -it vuln-nist-mcp-server74```7576## Configuration7778Environment variables:7980- `NVD_BASE_URL`: Base URL for NVD API (default: `https://services.nvd.nist.gov/rest/json`)81- `NVD_VERSION`: API version (default: `/2.0`)82- `NVD_API_TIMEOUT`: Request timeout in seconds (default: `10`)8384## Usage Examples8586### With Claude Desktop or MCP Client8788**Get temporal context for time-relative queries:**89```90Tool: get_temporal_context91Params: {}92```9394**Search recent CVEs (relative time):**95```96Tool: search_cves97Params: {98 "keyword": "Microsoft Exchange",99 "resultsPerPage": 10,100 "last_days": 7101}102```103104**Search CVEs with absolute date range:**105```106Tool: search_cves107Params: {108 "keyword": "buffer overflow",109 "start_date": "2024-01-01T00:00:00",110 "end_date": "2024-03-31T23:59:59"111}112```113114**Search CVEs for "this year" (use get_temporal_context first):**115```116# First, get temporal context117Tool: get_temporal_context118119# Then use the provided date mappings120Tool: search_cves121Params: {122 "keyword": "remote code execution",123 "start_date": "2025-01-01T00:00:00",124 "end_date": "2025-09-17T12:00:00"125}126```127128**Get CVE details:**129```130Tool: get_cve_by_id131Params: {"cve_id": "CVE-2024-21413"}132```133134**Check CPE vulnerabilities:**135```136Tool: cves_by_cpe137Params: {138 "cpe_name": "cpe:2.3:a:microsoft:exchange_server:2019:*:*:*:*:*:*:*",139 "is_vulnerable": "true"140}141```142143**Find recent KEV additions:**144```145Tool: kevs_between146Params: {147 "kevStartDate": "2024-01-01T00:00:00.000Z",148 "kevEndDate": "2024-03-31T23:59:59.000Z"149}150```151152## Performance Notes153154- Queries with date ranges > 90-120 days are automatically chunked for better performance155- Parallel processing reduces total query time for large date ranges156- Results are automatically sorted by publication date (newest first) across all chunks157158## Development159160### File Structure161162```163vuln-nist-mcp-server/164├── Dockerfile165├── glama.json166├── LICENSE167├── nvd_logo.png168├── README.md169├── requirements.txt170├── SECURITY.md171└── vuln_nist_mcp_server.py172```173174## Security Considerations175176- No API key required (public NVD endpoints)177- Container runs as non-root user (`mcpuser`)178- Input validation prevents injection attacks179- No persistent storage of sensitive data180- Network capabilities added only when required via Docker flags181182## Contributing1831841. Fork the repository1852. Create a feature branch1863. Make your changes1874. Test locally1885. Submit a pull request189190## License191192MIT - see LICENSE file for details193194## Changelog195196### v1.1.0197- **NEW**: Added `get_temporal_context` tool for temporal awareness and time-relative queries198- **ENHANCED**: `search_cves` now supports absolute date ranges with `start_date` and `end_date` parameters199- **ENHANCED**: Improved date filtering logic with priority: absolute dates → relative days → default 30 days200- **ENHANCED**: All tools now return results sorted chronologically (newest first) for better relevance201- **IMPROVED**: Better error handling for ISO-8601 date parsing202- **DEPRECATED**: `recent_days` parameter in `search_cves` (use `last_days` instead)203- **UPDATED**: Logo and visual improvements204205### v1.0.0206- Initial release207- Support for all major NVD API endpoints208- Automatic query chunking and parallel processing209- CPE format validation210- Comprehensive error handling
Full transparency — inspect the skill content before installing.