返回市场
漏洞情报服务器精简版

漏洞情报服务器精简版

作者:gnlds13 星标更新:2025-08-07

项目介绍

技术文档摘要

MCP CVE 情报服务器精简版

一款专为网络安全情报设计的模型上下文协议(MCP)服务器,提供统一访问来自多个权威来源(包括NVD、MITRE和GitHub安全公告)的漏洞数据。此精简版专注于核心CVE情报功能,为安全专业人士提供了必要的特性。

MIT License Node.js TypeScript NPM Package Downloads Docker GitHub Stars 代码质量 安全性 ESLint 维护状态

🚀 概述

MCP CVE 情报服务器精简版是一款专为安全专业人士、渗透测试人员和网络安全研究人员设计的模型上下文协议(MCP)服务器,这些人员需要将基本的漏洞情报整合到他们的AI工作流程中。此精简版专注于核心功能,从多个权威来源聚合数据,并通过标准化协议提供可操作的安全见解。

状态:精简版,具备核心CVE情报功能和简化功能。

关键特性(精简版)

  • 🔍 多源CVE情报:统一访问NVD、MITRE CVE记录和GitHub安全公告
  • 🎯 基本漏洞发现:基于模式检测Exploit-DB、GitHub PoCs、Metasploit和PacketStorm中的漏洞
  • 🧮 EPSS风险评分:环境感知型漏洞优先级划分,结合利用预测
  • 📊 完整CVSS支持:全面分析v4/v3/v2指标,智能严重性评估
  • 🔧 CPE基础发现:使用标准标识符识别产品特定漏洞
  • 📈 趋势分析:基于严重性、漏洞和活动的实时漏洞趋势分析
  • 📋 专业报告:生成多种格式的安全报告(Markdown、JSON、摘要)
  • ⚡ 性能优化:智能缓存、重试逻辑和简化处理
  • 🛡️ 安全第一:类型安全实现,全面的输入验证和清理
  • 🚦 流量控制:智能请求节流,具有来源特定限制
  • 📊 健康监控:实时来源可用性和性能跟踪

🛠️ 安装

先决条件

  • Node.js:20.0.0或更高版本
  • npm:随Node.js一起提供

快速开始

# 克隆仓库
git clone https://github.com/gnlds/mcp-cve-intelligence-server-lite.git
cd mcp-cve-intelligence-server-lite

# 安装依赖
npm install

# 构建项目
npm run build

# 启动服务器
npm start

Docker 部署

使用预构建镜像(推荐)

# 从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

# 服务器将在 http://localhost:13001 可用
# 健康检查:http://localhost:13001/health

使用 Docker Compose

# 使用提供的Docker设置
chmod +x docker-run.sh
./docker-run.sh up

# 服务器将在 http://localhost:13001 可用
# 健康检查:http://localhost:13001/health

从源码构建

# 如果要自定义,请本地构建
docker build -t mcp-cve-intelligence-server-lite:local .
docker run -d -p 13001:3001 mcp-cve-intelligence-server-lite:local

📋 关于高级Docker配置、定制化和部署选项,请参阅 docs/DOCKER.md

MCP客户端设置

要使用此服务器与兼容MCP的客户端,通过NPM安装并配置:

# 从NPM快速安装
npx @proug/mcp-cve-intelligence-server-lite@latest --help

VS Code配置:

{
  "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"
}

高级示例:

// 搜索最近的RCE漏洞
{
  "keyword": "远程代码执行",
  "severity": "HIGH,CRITICAL",
  "dateStart": "2024-01-01",
  "hasExploit": true,
  "limit": 100
}

// 查找Windows特权提升问题
{
  "keyword": "windows 特权提升",
  "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:"internal"、"dmz"、"internet-facing"
  • assetCriticality:"low"、"medium"、"high"、"critical"
  • securityControls:已部署的安全措施数组
  • patchingCapability:"limited"、"standard"、"rapid"

5. generateCveReport - 专业安全报告

生成多种格式的综合漏洞报告:

{
  "cveIds": ["CVE-2021-44228", "CVE-2022-22965"],
  "format": "markdown",
  "includeExploits": true,
  "includeMetrics": true,
  "includeMitigation": true
}

报告格式:

  • markdown:专业的Markdown报告
  • json:结构化的数据用于自动化
  • summary:执行摘要格式

报告部分:

  • 包含风险评估的执行摘要
  • 详细的漏洞分析
  • 利用的可用性和复杂性
  • 推荐的缓解策略
  • CVSS指标和环境评分

6. searchByCpe - 产品特定漏洞发现

使用CPE标识符查找影响特定产品的漏洞:

{
  "cpe": "cpe:2.3:a:apache:log4j:*:*:*:*:*:*:*:*",
  "severity": "HIGH,CRITICAL",
  "hasExploit": true,
  "limit": 50
}

CPE示例:

// 搜索所有Apache产品
{
  "cpe": "cpe:2.3:a:apache:*:*:*:*:*:*:*:*:*",
  "severity": "CRITICAL"
}

// Windows Server漏洞
{
  "cpe": "cpe:2.3:o:microsoft:windows_server:*:*:*:*:*:*:*:*",
  "hasExploit": true
}

// 特定版本目标
{
  "cpe": "cpe:2.3:a:apache:log4j:2.14.1:*:*:*:*:*:*:*",
  "includeExploits": true
}

7. getSourceHealth - 数据源监控

监控CVE数据源的健康状况和可用性:

{
  "includeMetrics": true,
  "includeLastUpdated": true
}

健康指标:

  • 源可用性状态
  • 响应时间和性能
  • 最后一次成功数据更新
  • API速率限制状态
  • 错误率和可靠性

命令行界面

该服务器包含一个全面的CLI,适用于生产部署和测试:

快速启动命令

# 使用HTTP传输快速启动
npm start -- quick-start --port 3001

# 使用默认MCP的stdio传输启动
npm start -- --transport stdio

# 使用自定义配置启动
npm start -- --transport http --port 3001 --log-level debug

配置管理

# 显示当前配置和环境
npm start -- config

健康监控与测试

# 通过HTTP端点进行基本健康检查
curl http://localhost:3001/health

# 通过MCP工具测试
curl -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -d '{"method": "tools/call", "params": {"name": "getSourceHealth", "arguments": {}}}'

Docker集成

# 生成Docker命令和部署信息
npm start -- docker --port 3001

高级选项

# 自定义传输和网络
npm start -- --transport http --port 3001 --host 0.0.0.0

# 设置调试日志级别
npm start -- --transport http --log-level debug

# 帮助和可用命令
npm start -- --help

实际使用示例

场景1:安全评估工作流程

# 1. 启动服务器进行评估
npm start -- quick-start --port 3001

# 2. 检查源健康状况
curl -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -d '{"method": "tools/call", "params": {"name": "getSourceHealth", "arguments": {}}}'

# 3. 在您的堆栈中搜索关键漏洞
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. 生成评估报告
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. 查找热门漏洞
npm start -- --transport http --port 3001

# 2. 研究具有利用的特定CVE
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. 计算环境风险
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:渗透测试准备

# 在目标技术中搜索可利用的漏洞
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}}}'

# 查找最近的RCE漏洞
curl -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -d '{"method": "tools/call", "params": {"name": "searchCves", "arguments": {"keyword": "远程代码执行", "dateStart": "2024-01-01", "hasExploit": true}}}'

配置

使用环境变量或.env文件配置服务器:

MCP客户端配置

要使用此服务器与兼容MCP的客户端(如VS Code、Claude Desktop等),您需要配置客户端以连接到此服务器。

对于VS Code:

在您的工作区创建一个.vscode/mcp.json文件:

{
  "servers": {
    "cve-intelligence": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "mcp-cve-intelligence-server-lite@latest"]
    }
  }
}

或者,对于全局配置,在VS Code中运行MCP: 打开用户配置并添加:

{
  "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密钥(可选)",
      "password": true
    },
    {
      "type": "promptString", 
      "id": "github-token",
      "description": "GitHub个人访问令牌(可选)",