Skip to main content
Glama

aws-bleed

ci npm JSR JSR Score Go license

5-second read-only scan for expensive AWS hidden taxes: NAT Gateway traffic to S3/DynamoDB without free gateway endpoints, CloudWatch Logs with infinite retention, gp2 and orphaned EBS volumes, idle Elastic IPs, and stale snapshots, complete with USD/month estimates and a fix-bleed.tf Terraform patch.

Install

Bun / npm:

bunx aws-bleed
npx aws-bleed

# or install in your project / globally
bun add -d aws-bleed
npm i -D aws-bleed

JSR:

bunx jsr add @kanchingyg/aws-bleed
npx jsr add @kanchingyg/aws-bleed

Go (native binary):

go install github.com/kanchingyg/aws-bleed@latest

The core engine is Go (main.go, internal/). TypeScript under src/*.ts is included for npx / bunx / JSR usage and MCP bridge helpers when no native binary is present.

Related MCP server: AWS Cost Saver

Quick start

npx aws-bleed
bunx aws-bleed
npx aws-bleed --patch fix-bleed.tf --allow-write
npx aws-bleed --mcp

What you get

Finding

Fix in patch

NAT in VPC without S3/DynamoDB gateway endpoints

aws_vpc_endpoint (Gateway)

Log groups with retentionInDays = null

retention_in_days

gp2 volumes

gp3 migration block

available volumes / idle EIPs / old snapshots

Comments + CLI cleanup hints

MCP + local models

npx aws-bleed --mcp
bunx aws-bleed --mcp

Use summarize_exec_report with --model ollama/llama3.2 (or any OpenAI-compatible local server) so cost data stays on your machine.

Requirements

  • Node 18+ or Bun for npx / bunx, or Go 1.22+ for native CLI

  • AWS credentials with read-only Describe* / List* (no writes unless you pass --allow-write for patch files)

MCP Tools Reference

Tool

Mutates

Description

scan_aws_bleed

false

Run read-only FinOps checks across NAT Gateways, VPC Gateway Endpoints, EBS volumes, Elastic IPs, snapshots, and CloudWatch Log Groups.

generate_finops_patch

false

Render a terraform or cloudformation remediation patch (aws_vpc_endpoint, gp3 migration, log retention).

write_finops_patch

true

Write the generated FinOps patch file to disk inside the workspace (requires --allow-write).

summarize_exec_report

false

Format a concise monthly waste report suitable for engineering review.

Editor and Agent Integration

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "aws-bleed": {
      "command": "npx",
      "args": ["-y", "aws-bleed", "--mcp"]
    }
  }
}

Claude Code CLI

claude mcp add aws-bleed -- npx -y aws-bleed --mcp

Programmatic Usage (JSR / TypeScript)

import * as bridge from "jsr:@kanchingyg/aws-bleed/bridge";

Runtime Safety and Guardrails

  • Stdio frame isolation: When --mcp is active, hijackStdoutForMcp() redirects accidental console.log calls to stderr so JSON-RPC 2.0 frames on stdout never corrupt.

  • Read-only by default: Mutating tools (mutates: true) are blocked in --dry-run mode and require explicit --allow-write authorization.

  • Loop breaker: Repeated identical (toolName, args) invocations are hashed with SHA-256 and halted after 3 consecutive repeats to prevent runaway agent loops.

  • Context budget truncation: Tool outputs are middle-truncated (60% head / 40% tail) scaled to the probed local model n_ctx (Ollama /api/show, llama.cpp /props, vLLM /v1/models).

  • Secret redaction and path normalization: AWS keys (AKIA*, ASIA*), bearer tokens, and sk-* keys are scrubbed before returning tool output, and Windows drive paths (C:\...) translate cleanly to /mnt/c/... when WSL mode is enabled.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      D
      quality
      D
      maintenance
      Enables read-only assessment of AWS environments by inventorying resources, running security and operational checks, and generating actionable reports with cost analysis. Designed for contractors with support for assume-role authentication using external IDs.
      10
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables scanning AWS accounts for cost optimization opportunities by reading resource configurations and pricing data, without making any modifications.
      24
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to run read-only AWS security audits and receive normalized, severity-ranked findings about account posture, such as stale access keys, missing MFA, public buckets, open security groups, and CloudTrail coverage.
      11
      25 PyPI
      MIT