MCPSERV.CLUB
norbinsh

Trivy Security Scanner MCP Server

MCP Server

Secure your code with automated Trivy scans and fixes

Stale(50)
10stars
2views
Updated Aug 25, 2025

About

A proof‑of‑concept MCP server that integrates Trivy into the Cursor IDE, automatically scanning projects for vulnerabilities and applying dependency updates across multiple package managers.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Trivy MCP Demo

Overview

The Trivy Security Scanner MCP Server is a lightweight bridge that exposes the powerful open‑source vulnerability scanner Trivy to AI assistants through the Model Context Protocol (MCP). It turns a local Trivy installation into an autonomous, language‑model‑friendly tool that can be invoked from within IDEs such as Cursor or any other MCP‑compatible client. By wrapping Trivy’s command line interface in a standardized HTTP API, developers can embed security checks directly into their conversational workflows without leaving the editor.

Problem Solved

Modern development teams increasingly rely on large language models to accelerate coding, refactor legacy code, or generate documentation. However, these models lack native access to project metadata and external tooling, making it difficult to surface up‑to‑date security information. The Trivy MCP Server solves this gap by providing a consistent, declarative interface for scanning dependencies and applying fixes. It removes the friction of manually running commands, parsing JSON reports, or handling version bumps—tasks that are cumbersome to automate in a conversational context.

What It Does

The server exposes two primary tools:

  • – Recursively scans a specified workspace for known vulnerabilities across multiple ecosystems (Python, Node.js, Ruby, Go, and more). The output is a structured vulnerability report that the assistant can interpret and summarize for the developer.
  • – Accepts a target package name and desired secure version, then updates the relevant dependency file (e.g., , ) and performs a follow‑up scan to confirm resolution.

Because the tools are defined in MCP, an assistant can request a scan or apply a patch with a single function call, and the server handles all underlying Trivy logic. The integration is seamless: after a dependency file change, an MCP rule can trigger , and if vulnerabilities are found, the assistant can call automatically.

Key Features & Capabilities

  • Multi‑package support – Handles diverse package managers out of the box, making it suitable for polyglot projects.
  • Automated patching – The tool not only updates the dependency file but also ensures that the new version is indeed secure by re‑scanning.
  • SSE transport – Uses Server‑Sent Events for low‑latency, real‑time feedback to the assistant, enabling live progress updates during long scans.
  • Rule‑driven workflow – Integrated with Cursor’s rule system, allowing developers to define triggers such as “scan after every dependency file edit,” ensuring continuous security hygiene.

Real‑World Use Cases

  • Continuous Security Checks – During a code review, an assistant can scan the current branch for vulnerabilities and suggest fixes before merging.
  • Automated Dependency Management – When a new package is added, the assistant can immediately verify its security posture and automatically upgrade to a safe version.
  • Compliance Auditing – Teams can schedule nightly scans via MCP and have the assistant generate compliance reports for auditors.
  • Educational Environments – Students learning secure coding can interactively see the impact of adding a vulnerable dependency and receive instant remediation guidance.

Integration with AI Workflows

Because MCP is language‑model agnostic, any LLM that supports the protocol can consume Trivy’s output. An assistant can:

  1. Call to obtain a vulnerability list.
  2. Summarize findings in natural language, highlight critical issues, and propose actionable steps.
  3. Invoke for each identified risk, optionally asking the developer for confirmation before applying changes.
  4. Re‑scan to confirm that all vulnerabilities are resolved, then report the final status.

This tight loop of detection, explanation, and remediation turns a static scanner into an interactive security partner that adapts to the developer’s workflow.

Unique Advantages

  • Zero‑configuration within the IDE – Once the server is running, no additional tooling or plugins are needed; the assistant can call Trivy functions directly.
  • Open‑source and lightweight – Built on top of the already popular Trivy scanner, it inherits all community support while adding a minimal MCP wrapper.
  • Proof‑of‑concept flexibility – Designed as an experiment, it encourages rapid iteration and community contributions to expand support for more ecosystems or advanced remediation strategies.

In summary, the Trivy MCP Server transforms a command‑line vulnerability scanner into an AI‑friendly service that empowers developers to maintain secure codebases effortlessly, integrating continuous security checks directly into their conversational coding experience.