Integrations
Enables searching for vulnerabilities related to Red Hat products in the NVD database using keyword search functionality
NVD 数据库 MCP 服务器
模型上下文协议服务器实现,通过其 API 查询 NIST 国家漏洞数据库 (NVD)。https ://nvd.nist.gov/
作为先决条件,需要 NVD API 密钥。(在此处请求)。
地位
与 Claude Desktop 应用程序和其他使用stdio
和sse
传输的 MCP 兼容主机和客户端配合使用。
特征
- 通过 ID 查询特定 CVE 以及详细的漏洞数据。
- 使用可自定义的结果选项通过关键字搜索 NVD 数据库。
- 支持服务器发送事件 (SSE) 传输以实现实时通信。
- 与 Claude Desktop 等符合 MCP 标准的客户端兼容。
工具
服务器实现以下工具来查询 NVD 数据库:
get_cve
:- 描述:通过 ID 检索 CVE 记录。
- 参数:
cve_id
(str): CVE ID(例如,CVE-2019-1010218
)。concise
(bool,默认为False
):如果为True
,则返回更短的格式。
- 返回:详细的 CVE 信息,包括分数、弱点和参考。
search_cve
:- 描述:通过关键字搜索 NVD 数据库。
- 参数:
keyword
(str):搜索词(例如,Red Hat
)。exact_match
(bool,默认为False
):如果为True
,则需要精确的短语匹配。concise
(bool,默认False
):如果为True
,则返回较短的 CVE 记录。results
(int,默认值为10
):CVE 记录的最大数量(1-2000)。
- 返回:匹配的 CVE 列表及其总数。
配置
- 创建或编辑位于以下位置的 Claude Desktop 配置文件:
- 在 macOS 上:
~/Library/Application Support/Claude/claude_desktop_config.json
- 在 Windows 上:
%APPDATA%/Claude/claude_desktop_config.json
- 在 macOS 上:
- 添加以下内容:
- 将
/path/to/uvx
替换为uvx
可执行文件的绝对路径。在终端中使用which uvx
命令查找路径。这可确保启动服务器时使用正确版本的uvx
。 - 重新启动 Claude Desktop 以应用更改。
发展
设置
- 设置环境变量:
- 在项目根目录中创建一个
.env
文件:Copy - 用您的 NVD API 密钥替换
your-api-key
。
- 在项目根目录中创建一个
- 安装依赖项:
使用 MCP 检查器运行
然后打开浏览器访问 MCP Inspector 指示的 URL,通常是http://localhost:8077?proxyPort=8078
在检查器中自由切换
stdio
和sse
传输类型。
使用 SSE 客户端进行测试
运行服务器:
- 默认在端口
9090
上使用 SSE 传输运行。
运行客户端:
测试get_cve
:
测试search_cve
(默认10个结果):
测试search_cve
(完全匹配,5个结果):
Docker 设置
建造
跑步
使用.env
:
使用环境变量:
自定义端口:
核实
测试:
笔记
- 确保
.env
具有NVD_API_KEY=your-key
或使用-e
。 - 默认端口:
9090
。
以下是代码块内格式化为 Markdown 注释的摘要,适合包含在docker-compose.yaml
或README.md
等文件中:
使用 Docker Compose 进行测试
docker-compose.yaml
位于tests/
目录中,它定义了一个使用预构建 Docker 镜像测试 MCP-NVD 服务器的服务。它专为测试用例而设计,类似于clickhouse
之类的独立服务,并且假定镜像是预先构建的,而不是每次都重新构建。
假设
- 预构建镜像:该服务使用标记为
mcp-nvd:test
的预构建镜像,该镜像可在本地或镜像仓库中获取。该镜像基于父目录中的Dockerfile
,该文件使用uv
设置了 MCP-NVD 服务器,并在端口 9090 上以 SSE 模式运行它。
如何构建图像
要创建mcp-nvd:test
图像:
- 导航到项目根目录:Copy
- 使用 Dockerfile 构建镜像:Copy
- 这将使用来自
pyproject.toml
和mcp_nvd/
模块的所有依赖项构建图像,并设置运行服务器的默认命令。
- 这将使用来自
运行服务
从tests/
目录:
- 访问:服务器运行在
http://localhost:9090
。 - 停止:
docker-compose down
。 - 环境:确保
NVD_API_KEY
在../.env
中或使用docker-compose --env-file ../.env up
。
在 Docker Compose 场景中运行test_tools.py
要在 Docker 环境中运行单元测试( test_tools.py
):
- 启动服务:确保
mcp-nvd
服务正在通过docker-compose up
运行。 - 执行到容器中:
- 使用以下命令识别容器名称(例如
mcp-nvd-mcp-nvd-1
):Copy - 在容器内运行测试:Copy
- 注意:假设
test_tools.py
已复制到镜像的/app/tests/
下。如果没有,请修改 Dockerfile 以包含以下内容:然后使用Copydocker build -t mcp-nvd:test .
从根目录重建映像。
- 使用以下命令识别容器名称(例如
- 替代方案:针对容器化服务在本地运行测试:Copy
- 这会在服务运行时针对
http://localhost:9090
进行测试。
- 这会在服务运行时针对
关键细节
- 端口:9090 暴露给 SSE 访问。
- 日志:存储在
log-data
卷中(可选)。 - 图像:在运行
docker-compose
之前必须构建一次并标记为mcp-nvd:test
。
感谢@sidharthrajaram为基于 SSE 的 MCP 客户端和服务器提供的工作模式: https://github.com/sidharthrajaram/mcp-sse
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
模型上下文协议服务器实现通过其 API 查询 NIST 国家漏洞数据库 (NVD)。
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that facilitates integration with OpenCTI, allowing users to query and retrieve cyber threat intelligence data via a standardized interface.Last updated -167TypeScriptMIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that enables searching and retrieving information from DevRev using its APIs with Claude.Last updated -22Python
- -securityFlicense-qualityA Model Context Protocol server that provides access to Shodan and VirusTotal APIs for cybersecurity analysis, enabling analysts to perform network intelligence operations including host lookups, vulnerability analysis, and threat intelligence gathering.Last updated -1TypeScript
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants to search and retrieve information about security exploits and vulnerabilities from the Exploit Database, enhancing cybersecurity research capabilities.Last updated -4TypeScriptMIT License