Supports scanning and fixing vulnerable dependencies in Node.js projects.
Supports scanning and fixing vulnerable dependencies in Python projects.
Supports scanning and fixing vulnerable dependencies in Ruby projects.
Provides security scanning capabilities for projects, automatically scanning directories for vulnerabilities and offering automated fixes to update vulnerable dependencies to secure versions across multiple package managers.
Trivy Security Scanner MCP Server
A Model Context Protocol (MCP) server that provides Trivy security scanning capabilities through a standardized interface.
⚠️ Note: This is a proof of concept project to demonstrate the integration capabilities between MCP, Cursor IDE, and Trivy. It's intended for experimentation and learning purposes only and is not production-ready. Use at your own risk.
Features
🔍 Project Scanning: Automatically scan your project directory for security vulnerabilities using Trivy
🛠️ Automated Fixes: Automatically update vulnerable dependencies to secure versions
📦 Multi-Package Support: Handles multiple package managers (Python, Node.js, Ruby, Go)
Demo
Architecture
Prerequisites
Python 3.12 or higher
Trivy installed on your system:
# macOS brew install trivy
Installation
Usage
Start the server using SSE transport:
The server exposes two tools:
scan_project
: Scans a directory for security vulnerabilitiesRequired argument:
workspace
- The directory path to scan
fix_vulnerability
: Updates a vulnerable package to a secure versionRequired arguments:
workspace
- The directory to modifypkg_name
- Name of the package to updatetarget_version
- Version to update to
Using with Cursor IDE
Start the server with SSE transport:
python server.py --transport sse --port 54321Configure in Cursor:
Open Settings
Go to Features > MCP Servers
Add:
http://127.0.0.1:54321/sse
Add the following to your .cursorrules file, create it if you don't have one yet:
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.This configuration will:
Automatically trigger a security scan when any dependency file is modified
Help identify vulnerabilities as soon as new dependencies are added
Ensure your project stays secure throughout development
if you want to use the tool manually, you can use prompt the agent to use the tool with the following prompt through the composer interface:
Please scan my project for security vulnerabilities
Why MCP?
MCP (Model Context Protocol) exists to solve a fundamental problem in working with large language models (LLMs): how to efficiently and consistently connect these models to external data sources and tools.
Learn more at modelcontextprotocol.io.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License
Acknowledgments
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.
Provides Trivy security scanning capabilities through a standardized interface, allowing users to scan projects for vulnerabilities and automatically fix them by updating dependencies.
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 -