Token导航 LogoToken导航TokenDH.com
Trivy Security Scanner MCP Server logo
安全风控stdio官方级别未说明来源级核验

Trivy Security Scanner MCP Server

MCP Server

A Model Context Protocol (MCP) server that provides Trivy security scanning capabilities through a standardized interface.

工具数

2

提示词数

0

GitHub Stars

10

资源数

0
安全PythonCursor开发工具集成Cursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

norbinsh

提供方

norbinsh

最后核验

2026/5/18 04:03

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv .venv

详细介绍

Trivy安全扫描器MCP服务器

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

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

特性

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

演示

Demo

建筑

┌─────────────┐     ┌──────────────┐     ┌─────────────┐
│  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 -要扫描的目录路径

  1. fix_vulnerability:将易受攻击的软件包更新为安全版本

- 必需参数: - workspace -要修改的目录 - pkg_name -要更新的包的名称 - target_version -要更新的版本

与Cursor IDE一起使用

  1. 使用SSE传输启动服务器:
   python server.py --transport sse --port 54321
  1. 在游标中配置:

- 打开设置 - 转到功能>MCP服务器 - 添加: http://127.0.0.1:54321/sse

  1. 将以下内容添加到.cursorules文件中,如果还没有,请创建它:
   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.

此配置将:

- 修改任何依赖文件时自动触发安全扫描 - 一旦添加新的依赖关系,帮助识别漏洞 - 确保您的项目在整个开发过程中保持安全

如果您想手动使用该工具,可以通过composer界面使用prompt the agent使用该工具并显示以下提示:

   Please scan my project for security vulnerabilities

为什么选择MCP?

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

了解更多信息,请访问 模型上下文协议.io.

贡献

欢迎投稿!请随时提交拉取请求。

许可证

MIT许可证

致谢

目录标签

目录标签

安全PythonCursor开发工具集成securitytrivysecurity-scannermcp-server安全扫描本地部署漏洞修复多包管理

支持客户端

Cursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

部署方式(deploymentType,部署类型)

local-only

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononelocal-only

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP