MCP CVE智能服务器精简版
流线型 模型上下文协议(MCP)服务器 对于网络安全情报,提供对来自多个权威来源的漏洞数据的统一访问,包括NVD、MITRE和GitHub安全咨询。这 Lite版本 专注于核心CVE情报功能,为安全专业人员提供基本功能。
 ](https://nodejs.org/)  ](https://www.npmjs.com/package/@proug/mcp-cve-intelligence-server-lite) ](https://www.npmjs.com/package/@proug/mcp-cve-intelligence-server-lite) ](https://github.com/gnlds/mcp-cve-intelligence-server-lite/pkgs/container/mcp-cve-intelligence-server-lite) ](https://github.com/gnlds/mcp-cve-intelligence-server-lite/stargazers)    
🚀 概述
MCP CVE智能服务器精简版是一个精简的 模型上下文协议(MCP)服务器 专为需要将基本漏洞情报集成到其人工智能工作流程中的安全专业人员、渗透测试人员和网络安全研究人员而设计。这 简化版 专注于核心功能,聚合来自多个权威来源的数据,并通过标准化协议提供可操作的安全见解。
状态:精简版,具有核心CVE智能功能和简化功能。
主要功能(精简版)
- 🔍 多源CVE情报:统一访问NVD、MITRE CVE记录和GitHub安全公告
- 🎯 基本漏洞发现:来自漏洞数据库、GitHub PoCs、Metasploit和PacketStorm的基于模式的检测
- 🧮 EPSS风险评分:利用漏洞预测进行环境背景感知的脆弱性优先级排序
- 📊 完整的CVSS支持:具有智能严重性评估的完整v4/v3/v2度量分析
- 🔧 基于CPE的发现:使用标准化标识符识别特定产品的漏洞
- 📈 趋势分析:基于严重性、漏洞利用和活动的实时漏洞趋势
- 📋 专业报告:生成多种格式的安全报告(Markdown、JSON、摘要)
- ⚡ 性能优化:智能缓存、重试逻辑和简化处理
- 🛡️ 安全第一:具有全面输入验证和净化功能的类型安全实施
- 🚦 速率限制:具有源特定限制的智能请求限制
- 📊 健康监测:实时源可用性和性能跟踪
🛠️ 安装
先决条件
- Node.js:20.0.0或更高
- npm:附带Node.js
快速开始
# Clone the repository
git clone https://github.com/gnlds/mcp-cve-intelligence-server-lite.git
cd mcp-cve-intelligence-server-lite
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm startDocker部署
使用预构建图像(推荐)
# Pull and run the latest image from Docker Hub
docker run -d \
--name mcp-cve-server \
-p 13001:3001 \
-e MCP_TRANSPORT_TYPE=http \
-e MCP_HTTP_PORT=3001 \
-e MCP_HTTP_HOST=0.0.0.0 \
proug/mcp-cve-intelligence-server-lite:latest
# Server will be available at http://localhost:13001
# Health check: http://localhost:13001/health使用Docker Compose
# Using the provided Docker setup
chmod +x docker-run.sh
./docker-run.sh up
# Server will be available at http://localhost:13001
# Health check: http://localhost:13001/health从源头构建
# Build locally if you want to customize
docker build -t mcp-cve-intelligence-server-lite:local .
docker run -d -p 13001:3001 mcp-cve-intelligence-server-lite:local📋 有关高级Docker配置、自定义和部署选项,请参阅
MCP客户端设置
要将此服务器与MCP兼容的客户端一起使用,请通过NPM安装并配置:
# Quick install from NPM
npx @proug/mcp-cve-intelligence-server-lite@latest --helpVS代码配置:
{
"servers": {
"cve-intelligence": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcp-cve-intelligence-server-lite@latest"]
}
}
}📋 有关完整的MCP客户端配置(VS Code、Claude Desktop等),请参阅 配置 下面的部分。
📖 用法
MCP工具可用(精简版)
服务器提供 7必备工具 进行全面的CVE情报和安全分析:
1. searchCves -高级CVE搜索和发现
使用灵活的标准和智能过滤搜索漏洞:
{
"keyword": "apache log4j",
"severity": "CRITICAL",
"hasExploit": true,
"dateStart": "2021-01-01",
"dateEnd": "2024-12-31",
"limit": 50,
"source": "nvd"
}高级示例:
// Search for recent RCE vulnerabilities
{
"keyword": "remote code execution",
"severity": "HIGH,CRITICAL",
"dateStart": "2024-01-01",
"hasExploit": true,
"limit": 100
}
// Find Windows privilege escalation issues
{
"keyword": "windows privilege escalation",
"severity": "MEDIUM,HIGH,CRITICAL",
"limit": 25
}2. getCveDetails -全面的CVE情报
通过漏洞利用分析检索详细的漏洞信息:
{
"cveId": "CVE-2021-44228",
"includeExploits": true,
"includeReferences": true
}答复包括:
- 完成CVSS v4/v3/v2指标和评分
- CWE分类和弱点分析
- 带有CPE标识符的受影响产品
- 来自多个来源的已知漏洞
- EPSS风险评分和概率
- 供应商建议和补丁
3. getTrendingCves -实时漏洞情报
根据活动和严重程度发现当前趋势漏洞:
{
"limit": 25,
"timeframe": "7d",
"minSeverity": "MEDIUM"
}趋势分析:
- 最近披露的高影响漏洞
- CVE漏洞利用活动增加
- 安全社区关注的漏洞
- 积极讨论和概念验证
4. calculateEpssScores -环境风险评估
计算上下文感知的EPSS分数,以确定漏洞优先级:
{
"cveIds": ["CVE-2021-44228", "CVE-2022-22965", "CVE-2023-23397"],
"environmentContext": {
"networkExposure": "internet-facing",
"assetCriticality": "critical",
"securityControls": ["waf", "ids", "edr"],
"patchingCapability": "rapid"
}
}环境背景:
networkExposure:“内部”、“dmz”、“面向互联网”assetCriticality:“低”、“中”、“高”、“临界”securityControls:部署的一系列安全措施patchingCapability:“有限”、“标准”、“快速”
5. generateCveReport -专业安全报告
以多种格式生成全面的漏洞报告:
{
"cveIds": ["CVE-2021-44228", "CVE-2022-22965"],
"format": "markdown",
"includeExploits": true,
"includeMetrics": true,
"includeMitigation": true
}报告格式:
markdown:专业降价报告json:用于自动化的结构化数据summary:执行摘要格式
报告章节:
- 风险评估执行摘要
- 详细的漏洞分析
- 利用可用性和复杂性
- 建议的缓解策略
- CVSS指标和环境评分
6. searchByCpe -产品特定漏洞发现
使用CPE标识符查找影响特定产品的漏洞:
{
"cpe": "cpe:2.3:a:apache:log4j:*:*:*:*:*:*:*:*",
"severity": "HIGH,CRITICAL",
"hasExploit": true,
"limit": 50
}CPE示例:
// Search for all Apache products
{
"cpe": "cpe:2.3:a:apache:*:*:*:*:*:*:*:*:*",
"severity": "CRITICAL"
}
// Windows Server vulnerabilities
{
"cpe": "cpe:2.3:o:microsoft:windows_server:*:*:*:*:*:*:*:*",
"hasExploit": true
}
// Specific version targeting
{
"cpe": "cpe:2.3:a:apache:log4j:2.14.1:*:*:*:*:*:*:*",
"includeExploits": true
}7. getSourceHealth -数据源监控
监控CVE数据源的健康状况和可用性:
{
"includeMetrics": true,
"includeLastUpdated": true
}健康指标:
- 源可用性状态
- 响应时间和性能
- 上次成功的数据更新
- API费率限制状态
- 错误率和可靠性
命令行接口
该服务器包括一个用于生产部署和测试的全面CLI:
快速启动命令
# Quick start with HTTP transport
npm start -- quick-start --port 3001
# Start with stdio transport (default MCP)
npm start -- --transport stdio
# Start with custom configuration
npm start -- --transport http --port 3001 --log-level debug配置管理
# Show current configuration and environment
npm start -- config健康监测和测试
# Basic health check via HTTP endpoint
curl http://localhost:3001/health
# Test via MCP tools
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-d '{"method": "tools/call", "params": {"name": "getSourceHealth", "arguments": {}}}'Docker集成
# Generate Docker commands and deployment info
npm start -- docker --port 3001高级选项
# Custom transport and networking
npm start -- --transport http --port 3001 --host 0.0.0.0
# Set log level for debugging
npm start -- --transport http --log-level debug
# Help and available commands
npm start -- --help实际使用示例
场景1:安全评估工作流程
# 1. Start the server for assessment
npm start -- quick-start --port 3001
# 2. Check source health
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-d '{"method": "tools/call", "params": {"name": "getSourceHealth", "arguments": {}}}'
# 3. Search for critical vulnerabilities in your stack
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-d '{"method": "tools/call", "params": {"name": "searchByCpe", "arguments": {"cpe": "cpe:2.3:a:apache:*:*:*:*:*:*:*:*:*", "severity": "CRITICAL"}}}'
# 4. Generate assessment report
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-d '{"method": "tools/call", "params": {"name": "generateCveReport", "arguments": {"cveIds": ["CVE-2021-44228"], "format": "markdown", "includeExploits": true}}}'场景2:威胁情报研究
# 1. Find trending vulnerabilities
npm start -- --transport http --port 3001
# 2. Research specific CVE with exploits
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-d '{"method": "tools/call", "params": {"name": "getCveDetails", "arguments": {"cveId": "CVE-2024-12345", "includeExploits": true}}}'
# 3. Calculate environmental risk
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-d '{"method": "tools/call", "params": {"name": "calculateEpssScores", "arguments": {"cveIds": ["CVE-2024-12345"], "environmentContext": {"networkExposure": "internet-facing", "assetCriticality": "critical"}}}}'场景3:渗透测试准备
# Search for exploitable vulnerabilities in target technology
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-d '{"method": "tools/call", "params": {"name": "searchCves", "arguments": {"keyword": "windows server 2019", "hasExploit": true, "severity": "HIGH,CRITICAL", "limit": 50}}}'
# Find recent RCE vulnerabilities
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-d '{"method": "tools/call", "params": {"name": "searchCves", "arguments": {"keyword": "remote code execution", "dateStart": "2024-01-01", "hasExploit": true}}}'配置
使用环境变量配置服务器或 .env 文件:
MCP客户端配置
要将此服务器与MCP兼容的客户端(VS Code、Claude Desktop等)一起使用,您需要配置客户端以连接到此服务器。
对于VS代码:
创建一个 .vscode/mcp.json 工作区中的文件:
{
"servers": {
"cve-intelligence": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcp-cve-intelligence-server-lite@latest"]
}
}
}或者,对于全局配置,请运行 MCP: Open User Configuration 在VS Code中添加:
{
"servers": {
"cve-intelligence": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcp-cve-intelligence-server-lite@latest"],
"env": {
"NVD_API_KEY": "${input:nvd-api-key}",
"GITHUB_TOKEN": "${input:github-token}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "nvd-api-key",
"description": "NVD API Key (optional)",
"password": true
},
{
"type": "promptString",
"id": "github-token",
"description": "GitHub Personal Access Token (optional)",
"password": true
}
]
}对于Claude Desktop:
添加到您的Claude Desktop配置文件(~/Library/Application Support/Claude/config.json 在macOS上):
{
"mcpServers": {
"cve-intelligence": {
"command": "npx",
"args": ["-y", "mcp-cve-intelligence-server-lite@latest"],
"env": {
"NVD_API_KEY": "your-optional-nvd-api-key",
"GITHUB_TOKEN": "your-optional-github-token"
}
}
}
}对于Docker容器:
您可以在Docker容器中运行MCP服务器,以增强安全性和隔离性:
*VS代码配置(STDIO传输):*
{
"servers": {
"cve-intelligence": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"proug/mcp-cve-intelligence-server-lite:latest"
]
}
}
}*VS代码配置(HTTP传输):*
{
"servers": {
"cve-intelligence": {
"url": "http://localhost:3001/mcp"
}
}
}*克劳德桌面配置(STDIO传输):*
{
"mcpServers": {
"cve-intelligence": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"proug/mcp-cve-intelligence-server-lite:latest"
],
"env": {
"NVD_API_KEY": "your-optional-nvd-api-key",
"GITHUB_TOKEN": "your-optional-github-token"
}
}
}
}*Claude桌面配置(HTTP传输):*
{
"mcpServers": {
"cve-intelligence": {
"command": "docker",
"args": [
"run",
"-d",
"--rm",
"-p", "3001:3001",
"-e", "MCP_TRANSPORT_TYPE=http",
"-e", "MCP_HTTP_PORT=3001",
"-e", "MCP_HTTP_HOST=0.0.0.0",
"-e", "NVD_API_KEY=your-optional-nvd-api-key",
"-e", "GITHUB_TOKEN=your-optional-github-token",
"proug/mcp-cve-intelligence-server-lite:latest"
]
}
}
}*Docker Compose(生产就绪):*
使用提供的docker-compose.yml进行生产部署:
# Start with HTTP transport on port 13001
./docker-run.sh up
# Server available at: http://localhost:13001
# Health check: http://localhost:13001/health/live备注:使用Docker时,MCP服务器在隔离的容器中运行。Docker镜像可从Docker Hub获得: ``bash # Pull the latest image docker pull proug/mcp-cve-intelligence-server-lite:latest # Or build locally from source: docker build -t mcp-cve-intelligence-server-lite:local . ``对于自定义实现:
在stdio模式下启动服务器,并通过标准输入/输出连接:
# Start server in stdio mode (default)
npx mcp-cve-intelligence-server-lite
# Or start in HTTP mode
npx mcp-cve-intelligence-server-lite --transport http --port 3001基本配置
# Core server settings
export MCP_HTTP_PORT="3001"
export MCP_TRANSPORT="http" # or "stdio"
export LOG_LEVEL="info" # debug, info, warn, error
export NODE_ENV="production" # development, production, testAPI身份验证(增强功能)
# NVD API (NIST) - Higher rate limits
export NVD_API_KEY="your-nvd-api-key"
# GitHub API - Higher rate limits for security advisories
export GITHUB_TOKEN="your-github-personal-access-token"
# MITRE CVE Program - Requires CVE Program membership
export MITRE_API_KEY="your-mitre-api-key"
export MITRE_API_ORG="your-organization-name"
export MITRE_API_USER="your-username"安全说明:出于安全原因,API密钥和令牌仅通过环境变量接受。它们不能通过CLI参数提供。
高级配置
# Rate limiting and performance
export CVE_CACHE_TTL="1800" # Cache TTL in seconds
export CVE_CACHE_MAX_SIZE="1000" # Maximum cache entries
export CVE_REQUEST_TIMEOUT="30000" # Request timeout in ms
export CVE_RETRY_ATTEMPTS="3" # Retry attempts for failed requests
# Security settings
export CVE_CORS_ORIGIN="*" # CORS allowed origins
export CVE_API_KEY_REQUIRED="false" # Require API key for access
export CVE_RATE_LIMIT="100" # Requests per window
export CVE_RATE_WINDOW="3600" # Rate limit window in seconds
# Logging and monitoring
export LOG_FILE_PATH="/app/logs" # Log file directory
export LOG_MAX_FILES="30" # Maximum log files to keep
export LOG_MAX_SIZE="100mb" # Maximum log file size
export METRICS_ENABLED="true" # Enable performance metrics环境文件示例
创建一个 .env 项目根目录中的文件:
# .env file for MCP CVE Intelligence Server Lite
NODE_ENV=development
MCP_HTTP_PORT=3001
LOG_LEVEL=debug
# API Keys (optional but recommended)
NVD_API_KEY=your-nvd-api-key-here
GITHUB_TOKEN=ghp_your-github-token-here
# Performance tuning
CVE_CACHE_TTL=3600
CVE_REQUEST_TIMEOUT=30000
CVE_RETRY_ATTEMPTS=3
# Security
CVE_CORS_ORIGIN=http://localhost:3000,https://yourdomain.com
CVE_RATE_LIMIT=200
CVE_RATE_WINDOW=3600Docker环境配置
# docker-compose.yml environment section
environment:
- NODE_ENV=production
- MCP_HTTP_PORT=3001
- LOG_LEVEL=info
- NVD_API_KEY=${NVD_API_KEY}
- GITHUB_TOKEN=${GITHUB_TOKEN}
- CVE_CACHE_TTL=1800
- CVE_RATE_LIMIT=100身份验证详细信息
| 源 | 身份验证 | 需要 | 安装程序 |
|---|---|---|---|
| 夜视装置 | 可选API密钥 | 更高的速率限制 | NVD_API_KEY |
| GitHub | 可选令牌 | 更高的速率限制 | GITHUB_TOKEN |
| 米特 | CVE计划成员资格 | 搜索功能 | MITRE_API_KEY, MITRE_API_ORG, MITRE_API_USER |
备注:MITRE搜索要求CVE计划成员具有秘书处角色。单个CVE查找无需身份验证即可工作。 📋 有关Docker特定的配置和部署选项,请参阅
🏗️ 架构(精简版)
核心组件
- CVE服务:用于漏洞分析的中央情报引擎
- 源管理器:通过故障转移管理多个CVE数据源
- 运输经理:处理STDIO和HTTP传输协议
- 卫生服务:监控数据源的可用性和性能
- 利用情报:基于模式的漏洞利用发现和分类
数据源(精简配置)
| 来源 | 目的 | 功能 | 身份验证 |
|---|---|---|---|
| NVD(NIST) | 主要CVE数据库 | CVSS指标、CPE匹配、基本搜索 | 可选(API密钥) |
| 米特 | 权威CVE记录 | 官方任务、CWE映射、CVE JSON 5.1 | CVE计划成员 |
| GitHub安全 | 现代漏洞咨询 | GHSA标识符、生态系统特定数据 | 可选(令牌) |
漏洞利用源(精简模式检测)
- 利用数据库:通过详细的文档和概念证明验证漏洞
- GitHub PoCs:前沿研究和概念验证库
- Metasploit框架:专业渗透测试模块和漏洞利用
- PacketStorm安全:精心策划的安全漏洞和安全建议
🔧 发展
快速开发设置
# Clone and setup
git clone https://github.com/gnlds/mcp-cve-intelligence-server-lite.git
cd mcp-cve-intelligence-server-lite
npm install
# Build and run
npm run build
npm start📋 有关详细的开发工作流程、调试、测试过程和贡献指南,请参阅 贡献.md
📊 性能特性(精简版)
- 基本缓存:智能缓存减少了API调用并改进了响应时间
- 简化处理:优化源查询以获得更快的结果
- 重试逻辑:带断路器的指数退避,用于可靠的API通信
- 请求优化:防止在时间窗口内重复调用API
- 性能监控:内置计时、指标收集和健康检查
- 连接管理:高效的HTTP连接处理
- 速率限制:关于API限制和配额的源特定节流
🔒 安全考虑
- 输入验证:对所有输入进行全面的Zod模式验证
- 消毒:多层输入消毒,防止注射攻击
- 速率限制:使用客户端标识和阻止进行请求限制
- 错误处理:安全的错误消息,不会暴露敏感数据
- 类型安全:严格的TypeScript实现,防止运行时错误
- API密钥管理:通过验证实现安全的环境变量处理
- 运输安全:HTTPS强制和安全标头
- 会话管理:HTTP传输的安全会话处理
🌟 用例(精简版)
面向安全专业人员
- 脆弱性评估:基本CVE研究和分析
- 威胁情报:实时漏洞趋势和优先级
- 渗透测试:利用发现和模式分析
- 合规报告:专业漏洞报告
用于AI/LLM集成
- 上下文感知安全:为人工智能模型提供漏洞背景
- 自动化研究:启用人工智能驱动的安全研究工作流程
- 智能优先级:人工智能辅助漏洞分类
- 报告生成:自动化安全文档
🤝 贡献
我们欢迎捐款!请查看我们的 贡献指南 有关以下内容的详细信息:
- 建立开发环境
- 代码风格指南
- 提交拉取请求
- 报告错误和功能请求
🛡️ 安全
此项目遵循安全最佳实践:
- 责任揭秘:查看我们的 安全策略 用于报告漏洞
- 安全开发:所有发布都经过自动安全扫描和审批流程
- 访问控制:存储库访问权限仅限于经过验证的维护人员
- 审计跟踪:所有生产部署都会被跟踪并需要批准
有关安全问题,请参阅我们的 安全策略.
📄 许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
🙋♂️ 支持
🏆 鸣谢
- NIST NVD:主要漏洞数据库
- MITRE公司:CVE编号机构
- GitHub安全:现代安全咨询平台
- 模型上下文协议:人工智能集成框架
______________________________________________________________________
内置于❤️ 网络安全社区
MCP CVE智能服务器精简版 -安全专业人员必备的CVE情报
