Skip to main content
Glama
aws-audit-mcp

aws-audit-mcp

by OmniNomadLLC

aws-audit-mcp

CI PyPI

Read-only AWS security audits, exposed as MCP tools. Point an AI agent at this server and it can answer "is this account in good shape?" with evidence instead of vibes: stale access keys, users without MFA, root account posture, public S3 buckets, world-open security groups, and CloudTrail coverage, each returned as normalized findings with severities an agent can reason about.

Demo: auditing a deliberately misconfigured account

Try it in 60 seconds, no AWS account needed

pip install "aws-audit-mcp[demo]"
curl -sO https://raw.githubusercontent.com/OmniNomadLLC/aws-audit-mcp/main/examples/demo.py
python demo.py

The demo builds a deliberately misconfigured account in moto (an in-memory AWS emulator, nothing leaves your machine) and runs the aggregated audit against it: seven findings, a posture score, and a letter grade, exactly what an agent gets back.

Related MCP server: AWS SRA Verify MCP Server

Read-only, and provably so

This server never mutates anything. That claim is enforced in three layers, not asserted once in a docstring:

  1. A single client factory. Every boto3 client in the codebase is created through aws_client() in common.py. Grep for aws_client( and you have every AWS touchpoint; there is nowhere else for a write call to hide.

  2. MCP tool annotations. Every tool is registered with ToolAnnotations(read_only_hint=True, destructive_hint=False), so MCP clients see the read-only contract at the protocol level.

  3. A CI eval. The test suite greps every tool module for mutating boto3 verbs (create, put, delete, update, attach, and friends) and fails the build if one appears.

Honesty requires one more sentence: the real security boundary is IAM, not this code. Run the server with the least-privilege policy in examples/iam-policy.json, which grants exactly the read actions the tools call and nothing else. The policy uses Resource: "*" because these are account-wide list and describe actions: auditing "all IAM users" or "all buckets" is inherently account-scoped, and constraining resources would silently blind the audit.

Quickstart

Install from PyPI (available after the first release):

pip install aws-audit-mcp

Or install from git (or a local clone):

pip install git+https://github.com/OmniNomadLLC/aws-audit-mcp.git

Add it to Claude Code:

claude mcp add aws-audit-mcp --env AWS_PROFILE=audit --env AWS_REGION=eu-west-1 -- aws-audit-mcp

Or for any MCP client, the generic config:

{
  "mcpServers": {
    "aws-audit-mcp": {
      "command": "aws-audit-mcp",
      "env": {
        "AWS_PROFILE": "audit",
        "AWS_REGION": "eu-west-1"
      }
    }
  }
}

Credentials resolve through the standard boto3 chain (AWS_PROFILE, environment variables, instance roles), the same way every AWS tool works.

Tools

Tool

Audits

Key severities

audit_stale_access_keys(max_age_days=90)

active IAM keys older than the threshold

HIGH if the user has no MFA, else MEDIUM

audit_users_without_mfa()

console users without MFA

HIGH

audit_root_account_posture()

root MFA and root access keys

CRITICAL for root keys, HIGH for missing MFA

audit_public_buckets()

bucket ACLs, wildcard-principal policies, missing or weakened public access block

HIGH / MEDIUM

audit_world_open_security_groups(region=None)

ingress from 0.0.0.0/0 or ::/0

HIGH on admin/db ports or all traffic, MEDIUM otherwise

audit_trail_posture(region=None)

trail exists, logging, multi-region, log validation, CMK

CRITICAL / MEDIUM / LOW

account_security_summary()

account id, IAM summary, account-level S3 public access block

HIGH / MEDIUM

audit_rds_posture(region=None)

publicly accessible, unencrypted, unprotected RDS instances

HIGH / MEDIUM / LOW

audit_ebs_exposure(region=None)

unencrypted EBS volumes and publicly shared snapshots

CRITICAL / MEDIUM

audit_lambda_resource_policies(region=None)

Lambda functions invocable by anyone or by unconditioned service principals

HIGH / MEDIUM

audit_full_posture()

runs every audit above and returns severity counts, a weighted posture score and a letter grade

aggregate

Every tool returns the same envelope: {check, ok, findings[], scanned}. Every finding has {check, severity, title, resource, detail} with severity one of LOW, MEDIUM, HIGH, CRITICAL. The scanned count exists so a clean result is trustworthy: scanned: 0, findings: [] and scanned: 200, findings: [] are very different answers.

Example output

{
  "check": "iam.stale_access_keys",
  "ok": false,
  "findings": [
    {
      "check": "iam.stale_access_keys",
      "severity": "HIGH",
      "title": "Active access key is 412 days old and the user has no MFA",
      "resource": "arn:aws:iam::111111111111:user/ci-deploy",
      "detail": {
        "access_key_id": "AKIAEXAMPLEEXAMPLE",
        "age_days": 412,
        "max_age_days": 90,
        "user_has_mfa": false
      }
    }
  ],
  "scanned": 14
}

Architecture

flowchart LR
    A[MCP client / AI agent] -- stdio --> B[server.py\nautodiscovery]
    B --> T1[tools/iam.py]
    B --> T2[tools/s3.py]
    B --> T3[tools/ec2.py]
    B --> T4[tools/cloudtrail.py]
    B --> T5[tools/rds.py, ebs.py,\nawslambda.py, account.py]
    B --> F[tools/full.py\naggregated posture]
    T1 & T2 & T3 & T4 & T5 --> C[common.py\nfinding / report / aws_client]
    C -- read-only API calls --> AWS[(AWS account)]

Six lines, because that is all there is:

  • server.py autodiscovers tool modules: anything in tools/ exposing register(mcp) is loaded.

  • One module per AWS surface: iam.py, s3.py, ec2.py, cloudtrail.py, account.py.

  • The shared contract lives in common.py: finding(), report(), and the aws_client() factory.

  • Adding a check means adding one module plus its tests; the server does not change.

Testing and evals

  • Unit tests run against moto, so every check is exercised against simulated AWS accounts with no credentials required.

  • Contract evals assert that every tool is documented, typed, annotated read-only, and returns the standard envelope.

  • A bad-account scenario eval builds a deliberately misconfigured moto account and asserts the tools catch every planted issue.

  • CI runs all of it on every push.

This project is built AI-assisted, with the discipline that makes that safe: every change passes the unit tests, the contract evals, and the machine-checked read-only gate before it lands on main. Every claim in this README is verified by CI, not by the author's memory.

The event-driven sibling of this project is aws-secops-lab: that one detects changes in seconds, this one audits state on demand.

License

MIT, see LICENSE.

Available Tools

11 tools
account_security_summaryA
Read-only

Cheap posture snapshot of the audited AWS account.

Collects:

  • the account id (sts.GetCallerIdentity); this identifies the audited account and is returned in the summary

  • iam.GetAccountSummary counters: Users, AccountMFAEnabled, AccountAccessKeysPresent

  • the account-level S3 public access block (s3control.GetPublicAccessBlock)

Findings:

  • HIGH when the root account has no MFA (AccountMFAEnabled != 1)

  • MEDIUM when the account-level S3 public access block is missing or any of its four flags is disabled

Returns: Report envelope: {check, ok, findings[], scanned, summary}. scanned is 1 (one account). summary holds the collected numbers and account_id. Each finding has {check, severity, title, resource, detail} with severity one of LOW/MEDIUM/HIGH/CRITICAL.

Inputs: no named parameters.

audit_ebs_exposureA
Read-only

Audit EBS volumes and snapshots for exposure risks.

Scans every EBS volume in the region (AWS_REGION or us-east-1 when the region argument is omitted) and flags unencrypted volumes as MEDIUM. Scans every snapshot owned by the account and checks its createVolumePermission attribute; a snapshot shared with the "all" group is public and is flagged CRITICAL.

Returns a dict {check, ok, findings, scanned, volumes_scanned, snapshots_scanned} where ok is true only when no findings were produced, findings is a list of normalized finding dicts, and scanned is the total number of volumes plus snapshots examined.

Inputs: region.

audit_full_postureA
Read-only

Run every registered audit check with default arguments and aggregate the results into a single account posture report.

Discovers all audit_*/account_* functions in the tool modules and runs each one; a failing check is recorded in errors and never aborts the rest. Returns the standard {check, ok, findings, scanned} envelope where findings is the concatenation of every sub-report's findings and scanned is the number of checks run, plus severity_counts (LOW/MEDIUM/HIGH/CRITICAL), posture_score, grade, checks_run, and errors. The score is weighted: each CRITICAL finding costs 10 points, HIGH 5, MEDIUM 2, LOW 1, and posture_score = max(0, 100 - total weight). Grades: A >= 90, B >= 75, C >= 60, D >= 40, else F.

Inputs: no named parameters.

audit_lambda_resource_policiesA
Read-only

Audit Lambda function resource policies for overly broad invoke access.

Scans every Lambda function in the region (AWS_REGION or us-east-1 when the region argument is omitted) and inspects its resource policy, if any. An Allow statement with a wildcard principal ("" or {"AWS": ""}) and no SourceArn/SourceAccount condition is HIGH: anyone can invoke the function. A service principal (for example s3.amazonaws.com) without any source condition is MEDIUM: any account's use of that service can invoke it. Service principals scoped by a SourceArn or SourceAccount condition are normal and are not flagged.

Returns a dict {check, ok, findings, scanned} where ok is true only when no findings were produced, findings is a list of normalized finding dicts (detail includes the statement sid, the principal and whether a condition exists), and scanned is the number of functions examined.

Inputs: region.

audit_public_bucketsA
Read-only

Audit every S3 bucket in the account for public exposure.

For each bucket this checks: the Public Access Block configuration (missing or any of the four flags disabled yields a MEDIUM finding), the bucket policy (any Allow statement with principal "" or {"AWS": ""} yields a HIGH finding), and the bucket ACL (grants to the AllUsers or AuthenticatedUsers groups yield a HIGH finding).

Returns a dict {check, ok, findings, scanned} where ok is true only when no findings were produced, findings is a list of normalized finding dicts (check, severity, title, resource, detail), and scanned is the number of buckets examined. Buckets that raise an unexpected AWS error are skipped and reported under an extra "errors" key mapping bucket name to error code. Severity: HIGH means the bucket is likely publicly reachable right now; MEDIUM means a guardrail is missing.

Inputs: no named parameters.

audit_rds_postureA
Read-only

Audit RDS instance posture: public accessibility, storage encryption, and deletion protection.

Scans every RDS DB instance in the region. A publicly accessible instance is a HIGH finding, unencrypted storage is MEDIUM, and disabled deletion protection is LOW. Returns the {check, ok, findings[], scanned} envelope where scanned is the number of DB instances examined; each finding carries the engine, the endpoint address when public, and the raw posture flags.

Inputs: region.

audit_root_account_postureA
Read-only

Audit the root account for missing MFA and active root access keys.

Reads the IAM account summary. No root MFA is a HIGH finding; any root access key present is a CRITICAL finding. Returns {check, ok, findings[], scanned} with scanned=1 (the single root identity) and the raw summary values in each finding's detail.

Inputs: no named parameters.

audit_stale_access_keysA
Read-only

Audit IAM users for active access keys older than max_age_days.

Scans every IAM user and flags each Active access key whose age exceeds max_age_days. Returns {check, ok, findings[], scanned} where scanned is the number of users examined. Severity is HIGH when the key's owner has no MFA device (a leaked key is the only factor), MEDIUM when the owner has MFA.

Inputs: max_age_days.

audit_trail_postureA
Read-only

Audit CloudTrail trail posture in the account.

Checks, per trail (shadow trails included, so multi-region trails homed in another region are still seen):

  • trail exists at all (zero trails is a CRITICAL finding on its own)

  • the trail is actively logging (GetTrailStatus.IsLogging), CRITICAL if not

  • IsMultiRegionTrail, MEDIUM if single-region

  • LogFileValidationEnabled, MEDIUM if disabled

  • KmsKeyId present, LOW if logs are not encrypted with a customer managed key

Args: region: AWS region to query (defaults to AWS_REGION or us-east-1).

Returns: Report envelope: {check, ok, findings[], scanned}. scanned is the number of trails inspected; ok is true only when no findings exist. Each finding has {check, severity, title, resource, detail} with severity one of LOW/MEDIUM/HIGH/CRITICAL and resource "trail/" (or "account" for the zero-trails finding).

Inputs: region.

audit_users_without_mfaA
Read-only

Audit IAM users that can log in to the console without MFA.

Scans every IAM user, checks which ones have a console login profile, and flags those with no MFA device as HIGH severity. Returns {check, ok, findings[], scanned} where scanned is the number of users examined; users without console access are counted but never flagged.

Inputs: no named parameters.

audit_world_open_security_groupsA
Read-only

Audit EC2 security groups for ingress rules open to the world.

Scans every security group in the region (AWS_REGION or us-east-1 when the region argument is omitted) and flags each ingress rule whose source is 0.0.0.0/0 or ::/0. Rules allowing all traffic (protocol -1) or covering a sensitive port (SSH 22, RDP 3389, MySQL 3306, PostgreSQL 5432, Redis 6379, Elasticsearch 9200, MongoDB 27017) are HIGH; any other world-open port (for example 80 or 443) is MEDIUM.

Returns a dict {check, ok, findings, scanned} where ok is true only when no findings were produced, findings is a list of normalized finding dicts (check, severity, title, resource, detail with protocol, from_port, to_port, cidrs, group_name), and scanned is the number of security groups examined.

Inputs: region.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.5/5.0

    Scored across 11 tools

    Disambiguation4/5

    Each tool targets a distinct AWS resource or audit domain (RDS, Lambda, CloudTrail, EBS, security groups, IAM, S3, root account), and the descriptions clearly specify scope. Minor overlap exists between account_security_summary and audit_root_account_posture (both touch root MFA) and between account-level and per-bucket S3 public access block checks, but the boundaries are still understandable.

    Naming Consistency4/5

    The overwhelming majority follow a consistent audit_<resource>_<topic> pattern, which is predictable and searchable. Exceptions include account_security_summary (missing the audit_ prefix) and audit_world_open_security_groups (more verbose than the posture-named checks), but these are minor deviations rather than a broken convention.

    Tool Count5/5

    11 tools is well within the ideal range and each tool corresponds to a meaningful audit check or aggregation layer. audit_full_posture consolidates the others instead of adding redundant surface area.

    Completeness4/5

    The server covers a broad set of critical AWS audit areas: compute, storage, database, serverless, networking, identity, root account, CloudTrail, and account-level posture. It lacks some optional AWS audit angles such as EC2 instance IMDS or KMS key audits, but for a security audit MCP the core lifecycle is well represented and the aggregate tool ties everything together.

    Maintenance

    ActivityStale
    ResponsivenessOutdated data

    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
      A
      quality
      B
      maintenance
      Enables AI agents to assess AWS environments against the AWS Security Reference Architecture (SRA) by providing tools to discover, describe, and run security checks across AWS services and accounts.
      5
      3
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Cloud security audit tools for AI agents that provide direct access to cloud APIs to read, correlate, and fix misconfigurations across AWS, Azure, and GCP.
      23
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude AI to automatically audit AWS cloud resource configurations, diagnose security vulnerabilities, and generate high-availability optimization reports.
      -