Trivy安全扫描MCP服务器

Trivy安全扫描MCP服务器

一个通过标准化接口提供Trivy安全扫描功能的MCP服务器。

快速入门

前置条件

  • 安装 Python 3.12 或更高版本
  • 安装 Trivy(macOS:brew install trivy

安装与运行

  1. 克隆仓库并进入目录
  2. 创建虚拟环境并安装依赖:
    python -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
    
  3. 启动服务:
    python server.py --transport sse --port 54321
    

使用方法

  • 自动扫描:修改依赖文件后,系统会自动触发扫描。
  • 手动扫描:在 Cursor IDE 中输入 请扫描我的项目以查找安全漏洞

配置 Cursor IDE

  1. 打开设置,前往 Features > MCP Servers。
  2. 添加地址:http://127.0.0.1:54321/sse
  3. .cursorrules 文件中添加规则: 修改依赖文件后,扫描项目以发现漏洞。

更多详情参考 README。