Skip to main content

Official Anchore Grype MCP Server for AI-assisted vulnerability scanning

Project description

Grype MCP Server

PyPI version Python Support License

Anchore MCP server for Grype vulnerability scanner

Integrate Grype vulnerability scanning directly into AI-assisted development workflows through the Model Context Protocol (MCP).

🚀 Quick Start

Installation

Install using uvx (recommended):

uvx install grype-mcp

Or using pipx:

pipx install grype-mcp

Or using pip:

pip install grype-mcp

MCP Client Setup

Claude Desktop

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "grype": {
      "command": "uvx",
      "args": ["grype-mcp"]
    }
  }
}

Other MCP Clients

For other MCP-compatible clients, add the server using:

  • Command: uvx
  • Args: ["grype-mcp"]

Start using Grype's vulnerability scanning capabilities!

🛠️ Available Tools

The Grype MCP server provides these tools for AI assistants:

System Management

  • find_grype - Check if Grype is installed and get version info
  • update_grype - Install or update Grype to the latest version
  • get_db_info - Get vulnerability database status and version info
  • update_db - Update the vulnerability database

Vulnerability Scanning

  • scan_dir - Scan project directories for vulnerabilities
  • scan_purl - Scan specific packages using PURL format (e.g., pkg:npm/lodash@4.17.20)
  • scan_image - Scan container images for vulnerabilities

Vulnerability Research

  • search_vulns - Search the vulnerability database by CVE, package name, or CPE
  • get_vuln_details - Get detailed information about specific CVEs

💡 Example Usage

Once configured, you can ask:

  • "Check if Grype is installed and up to date"
  • "Scan my project directory for vulnerabilities"
  • "Is pkg:npm/lodash@4.17.20 vulnerable?"
  • "Scan the nginx:latest Docker image"
  • "Search for Log4j vulnerabilities"
  • "Get details about CVE-2021-44228"

🔧 Requirements

  • Python 3.10+
  • Grype (can be installed via the update_grype tool)
  • Docker (optional, for container image scanning)

The MCP server can help install Grype if it's not already available using the update_grype tool.

📋 Supported Scanning Targets

  • Directories - Scan entire projects with all their dependencies
  • Container Images - Docker images from any registry
  • Package URLs - Individual packages in PURL format
    • npm: pkg:npm/package@version
    • Python: pkg:pypi/package@version
    • Go: pkg:golang/package@version
    • Java: pkg:maven/group/artifact@version
    • And many more ecosystems

🏗️ Architecture

The MCP server acts as a bridge between AI assistants and Grype:

AI Assistant ↔ MCP Server ↔ Grype CLI ↔ Vulnerability Database
  • Zero modifications to Grype required
  • Structured JSON responses optimized for AI consumption
  • Comprehensive error handling with helpful messages
  • Automatic tool management for easy setup

🤝 Contributing

We welcome contributions! Please see:

📄 License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

🔗 Related Projects

📞 Support


Made with ❤️ by the Anchore team for the AI-assisted development community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grype_mcp-0.4.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grype_mcp-0.4.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file grype_mcp-0.4.0.tar.gz.

File metadata

  • Download URL: grype_mcp-0.4.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for grype_mcp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 796bd68f579c7e3471930025c47e0d37d02885faafa042d9ed5894e0ab652da4
MD5 8e79d59eb4ec26058afa963ff8866491
BLAKE2b-256 ba08feb07f012c4c12776b795ec9f47d1fda83c697bedad9c8bcbbf6a95754ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for grype_mcp-0.4.0.tar.gz:

Publisher: workflow.yml on anchore/grype-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file grype_mcp-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: grype_mcp-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for grype_mcp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45bc16ac2a006ac090381f3326256dcd6c860c6173fffc4749e1200ce5525e6c
MD5 d4c4d9bc7f51b17f427e8e2e84303a29
BLAKE2b-256 6fd9dfcb45c1820b660c13a40bb722d3b6ef27ac0f66626d9728f08bb32e8b77

See more details on using hashes here.

Provenance

The following attestation bundles were made for grype_mcp-0.4.0-py3-none-any.whl:

Publisher: workflow.yml on anchore/grype-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page