Trivy セキュリティ スキャナー MCP サーバー
標準化されたインターフェースを通じて Trivy セキュリティ スキャン機能を提供するモデル コンテキスト プロトコル (MCP) サーバー。
⚠️注:これは、MCP、Cursor IDE、Trivy の統合機能を実証するための概念実証プロジェクトです。実験と学習のみを目的としており、本番環境での使用には対応していません。自己責任でご利用ください。
特徴
🔍プロジェクトスキャン: Trivy を使用してプロジェクトディレクトリのセキュリティ脆弱性を自動的にスキャンします
🛠️自動修正: 脆弱な依存関係を安全なバージョンに自動的に更新します
📦マルチパッケージサポート:複数のパッケージマネージャー(Python、Node.js、Ruby、Go)に対応
デモ
建築
前提条件
Python 3.12以上
システムにインストールされた Trivy:
# macOS brew install trivy
インストール
使用法
SSE トランスポートを使用してサーバーを起動します。
サーバーは 2 つのツールを公開します。
scan_project
: ディレクトリのセキュリティ脆弱性をスキャンします必須引数:
workspace
- スキャンするディレクトリパス
fix_vulnerability
: 脆弱なパッケージを安全なバージョンに更新する必要な引数:
workspace
- 変更するディレクトリpkg_name
- 更新するパッケージの名前target_version
- 更新するバージョン
カーソルIDEでの使用
SSE トランスポートを使用してサーバーを起動します。
python server.py --transport sse --port 54321カーソルで設定:
設定を開く
機能 > MCPサーバーへ移動
追加:
http://127.0.0.1:54321/sse
次の内容を .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をご覧ください。
貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。
ライセンス
MITライセンス
謝辞
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
標準化されたインターフェースを通じて Trivy セキュリティ スキャン機能を提供し、ユーザーがプロジェクトの脆弱性をスキャンし、依存関係を更新することで自動的に修正できるようにします。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA security testing tool that enables automated vulnerability detection including XSS and SQL injection, along with comprehensive browser interaction capabilities for web application penetration testing.Last updated -1252120MIT License
- -securityAlicense-qualityA comprehensive system that helps organizations track, manage, and respond to security vulnerabilities effectively through features like vulnerability tracking, user management, support tickets, API key management, and SSL certificate management.Last updated -MIT License
- -securityAlicense-qualityEnables comprehensive security scanning of code repositories to detect secrets, vulnerabilities, dependency issues, and configuration problems. Provides real-time security checks and best practice recommendations to help developers identify and prevent security issues.Last updated -42MIT License
- -securityFlicense-qualityEnables vulnerability scanning of web applications using the xray security scanner. Provides URL scanning capabilities with configurable crawlers, plugins, and POCs to detect security vulnerabilities through natural language interactions.Last updated -