Skip to main content
Glama
aws-samples

MCP Security Scanner

Official
by aws-samples

scan_with_ash

Scan code snippets using ASH to uncover security issues from multiple scanners like Bandit, Checkov, and detect-secrets. Get aggregated findings with adjustable severity thresholds.

Instructions

Scan code using ASH (Automated Security Helper) for comprehensive security analysis.

ASH is a comprehensive security scanning tool that runs multiple security scanners including Bandit, Checkov, cfn-nag, cdk-nag, detect-secrets, and more.

Note: Semgrep is excluded from ASH scans because there's a separate scan_with_semgrep tool.

This tool performs delta scanning on the provided code snippet, creating a temporary file and scanning it with ASH in local mode. This approach is optimized for scanning code changes rather than entire projects.

Supported file types:

  • Python (.py): Scanned with Bandit, detect-secrets

  • JavaScript/TypeScript (.js, .ts): Scanned with npm-audit

  • Terraform (.tf): Scanned with Checkov

  • CloudFormation (.yaml, .yml, .json): Scanned with Checkov, cfn-nag, cdk-nag

  • Dockerfile: Scanned with Checkov

  • And many more formats supported by the underlying scanners

For Semgrep scanning, use the separate scan_with_semgrep tool.

Args: code: The code content to analyze file_extension: File extension to determine scanner selection (e.g., '.py', '.tf', 'Dockerfile') severity_threshold: Minimum severity level to report (LOW, MEDIUM, HIGH, CRITICAL)

Returns: A dictionary with aggregated scan results from multiple scanners

Note: ASH must be installed and available in PATH. Install with: uvx git+https://github.com/awslabs/automated-security-helper.git@v3.2.1 or: pip install git+https://github.com/awslabs/automated-security-helper.git@v3.2.1

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesCode content to scan
file_extensionYesFile extension (e.g., .py, .tf, .js, Dockerfile)
severity_thresholdNoMinimum severity threshold (LOW, MEDIUM, HIGH, CRITICAL)MEDIUM

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the tool performs delta scanning, creates a temporary file, runs in local mode, and requires ASH to be installed with specific install commands. This is substantial behavioral transparency, though it doesn't mention failure modes or timeout behaviors, hence not a 5.

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 clear sections: overview, file types, args, returns, and install notes. It is somewhat long and repeats the Semgrep exclusion twice, but overall each section adds relevant information. Slight redundancy prevents a 5.

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

Completeness5/5

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

The description covers all essential aspects: what it does, how it scans, file-type support, parameters, return type, and installation prerequisites. An output schema exists, so the return dictionary is already indicated. This is thoroughly complete for a security scanning tool.

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?

The schema covers 100% of parameters, and the description enriches this by explaining how file_extension maps to specific scanners and file types. It also clarifies the meaning of severity_threshold. This adds value beyond the schema descriptions, earning above the baseline 3.

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's purpose: scanning code with ASH for comprehensive security analysis. It lists specific scanners and explicitly distinguishes itself from the sibling scan_with_semgrep tool. The verb 'Scan' plus the resource and scope ('code snippet') make it unambiguous and well-differentiated.

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

Usage Guidelines4/5

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

The description gives clear context for usage, including supported file types and the note that Semgrep is intentionally excluded and should be handled by scan_with_semgrep. It also explains the delta-scanning approach. A stronger explicit 'when to use ASH vs. individual scanners' would push it to 5, but the guidance is solid.

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