Skip to main content
Glama

Trivy Security Scanner MCP Server

by norbinsh

Trivy 安全扫描器 MCP 服务器

通过标准化接口提供 Trivy 安全扫描功能的模型上下文协议 (MCP) 服务器。

⚠️注意:这是一个概念验证项目,旨在演示 MCP、Cursor IDE 和 Trivy 之间的集成功能。它仅用于实验和学习目的,尚未投入生产。使用风险自负。

特征

  • 🔍项目扫描:使用 Trivy 自动扫描项目目录中的安全漏洞
  • 🛠️自动修复:自动将易受攻击的依赖项更新为安全版本
  • 📦多包支持:处理多个包管理器(Python、Node.js、Ruby、Go)

演示

演示

建筑学

┌─────────────┐ ┌──────────────┐ ┌─────────────┐ │ Cursor IDE │ --> │ MCP Server │ --> │ Trivy │ │ (Composer) │ │ │ │ │ └─────────────┘ └──────────────┘ └─────────────┘

先决条件

  • Python 3.12 或更高版本
  • 您的系统上安装了 Trivy:
    # macOS brew install trivy

安装

# Create and activate virtual environment python -m venv .venv source .venv/bin/activate # Install dependencies pip install -r requirements.txt

用法

使用 SSE 传输启动服务器:

# Using SSE transport (default) python server.py --transport sse --port 54321

该服务器公开了两个工具:

  1. scan_project :扫描目录以查找安全漏洞
    • 必需参数: workspace - 要扫描的目录路径
  2. fix_vulnerability :将易受攻击的软件包更新为安全版本
    • 必需参数:
      • workspace -要修改的目录
      • pkg_name要更新的包的名称
      • target_version - 要更新到的版本

与 Cursor IDE 一起使用

  1. 使用 SSE 传输启动服务器:
    python server.py --transport sse --port 54321
  2. 在游标中配置:
    • 打开“设置”
    • 前往“功能”>“MCP 服务器”
    • 地址: http://127.0.0.1:54321/sse ://127.0.0.1:54321/sse
  3. 将以下内容添加到您的 .cursorrules 文件中,如果还没有,请创建它:
    After making changes in any of the package dependency/manifest files, scan the project for security vulnerabilities. Fixes should only be according to the desired version reported by the scanner. If the scanner reports a fix unrelated to our change, ignore it. After performing the fix, scan the project for security vulnerabilities again.
    此配置将:
    • 当任何依赖文件被修改时自动触发安全扫描
    • 添加新的依赖项后立即帮助识别漏洞
    • 确保您的项目在整个开发过程中保持安全

    如果您想手动使用该工具,您可以通过作曲家界面使用以下提示来提示代理使用该工具:

    Please scan my project for security vulnerabilities

为什么选择 MCP?

MCP(模型上下文协议)的存在是为了解决使用大型语言模型(LLM)时的一个基本问题:如何有效且一致地将这些模型连接到外部数据源和工具。

请访问modelcontextprotocol.io了解更多信息。

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

执照

MIT 许可证

致谢

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

通过标准化接口提供Trivy安全扫描功能,允许用户扫描项目漏洞并通过更新依赖项自动修复漏洞。

  1. 特征
    1. 演示
      1. 建筑学
      2. 先决条件
      3. 安装
      4. 用法
      5. 与 Cursor IDE 一起使用
      6. 为什么选择 MCP?
      7. 贡献
      8. 执照
      9. 致谢

    Related MCP Servers

    • -
      security
      F
      license
      -
      quality
      A standalone Model Context Protocol server for Snyk security scanning functionality.
      Last updated -
      2
      1
      JavaScript
    • -
      security
      F
      license
      -
      quality
      A standalone server enabling Snyk security scanning through the Model Context Protocol, with support for repository and project analysis, token verification, and CLI integration.
      Last updated -
      1
      JavaScript
    • -
      security
      A
      license
      -
      quality
      Provides comprehensive security analysis tools for querying the VirusTotal API, enabling detailed security reports on URLs, files, IP addresses, and domains with automatic relationship data fetching.
      Last updated -
      2
      Python
      Apache 2.0
    • A
      security
      F
      license
      A
      quality
      A Model Context Protocol server that performs Trivy scans to generate Software Bill of Materials (SBOM) in CycloneDX format.
      Last updated -
      1
      1
      Python
      • Linux
      • Apple

    View all related MCP servers

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/norbinsh/cursor-mcp-trivy'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server