Skip to main content
Glama
aws-samples

MCP Security Scanner

Official
by aws-samples

scan_with_trivy

Scan Infrastructure as Code and Dockerfiles with Trivy to detect misconfigurations, vulnerabilities, and security issues across Dockerfile, Terraform, Kubernetes, and config files.

Instructions

Scan Infrastructure as Code or Dockerfile using Trivy for security issues.

Trivy is a comprehensive security scanner that can detect:

  • Misconfigurations in IaC files

  • Security issues in Dockerfiles

  • Vulnerabilities in base images (when scanning Dockerfiles)

  • Best practice violations

Supported scan types:

  • dockerfile: Scan Dockerfile for security issues and misconfigurations

  • terraform: Scan Terraform configuration files

  • kubernetes: Scan Kubernetes manifests

  • config: Generic configuration file scanning

Args: code: The code content to analyze scan_type: Type of scan to perform (dockerfile, terraform, kubernetes, config)

Returns: A dictionary with scan results including found security issues

Note: Trivy must be installed and available in PATH. Install with: - macOS: brew install trivy - Linux: See https://aquasecurity.github.io/trivy/latest/getting-started/installation/

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesCode content to scan (Dockerfile or IaC config)
scan_typeNoType of scan: dockerfile, terraform, kubernetes, or configdockerfile

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It discloses the installation requirement for Trivy (with install instructions), notes the return format (a dictionary with scan results), and lists the types of issues it detects. This provides valuable behavioral context beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with sections for supported scans, Args, Returns, and Notes. While somewhat long, each section provides useful information without unnecessary filler. The opening line is clear and the list format improves readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema and only two parameters, the description covers the essential aspects: supported scan types, return type, and the installation prerequisite. It doesn't explain the contents of the returned dictionary, but the output schema covers that, so the description is adequately complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the description doesn't need to compensate much. It adds meaning by explicitly enumerating the valid values for scan_type (dockerfile, terraform, kubernetes, config) and clarifying what 'code' should contain, going slightly beyond the schema's generic descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool scans Infrastructure as Code or Dockerfiles using Trivy, with a specific verb ('Scan'), resource, and tool named. It includes a list of supported scan types (dockerfile, terraform, kubernetes, config), which distinguishes it from sibling tools like scan_with_checkov or scan_with_semgrep.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description lists supported scan types and specifies Trivy as the scanner, implying usage for security scanning of IaC and Dockerfiles. However, it provides no explicit guidance on when to choose this tool over alternatives like Checkov or Semgrep, and no exclusions are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aws-samples/sample-mcp-security-scanner'

If you have feedback or need assistance with the MCP directory API, please join our Discord server