aws-audit-mcp
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.
Read-only, and provably so
This server never mutates anything. That claim is enforced in three layers, not asserted once in a docstring:
- A single client factory. Every boto3 client in the codebase is created through
aws_client()incommon.py. Grep foraws_client(and you have every AWS touchpoint; there is nowhere else for a write call to hide. - 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. - 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
Six lines, because that is all there is:
server.pyautodiscovers tool modules: anything intools/exposingregister(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 theaws_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.
Related
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aws_audit_mcp-0.2.0.tar.gz.
File metadata
- Download URL: aws_audit_mcp-0.2.0.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ead28f9f4215dc8e8f58fdaec4cc6250690b05ccc3a727d48a26bf3a9510e9e
|
|
| MD5 |
efe6891d72a97c1492d0f9b7725c8843
|
|
| BLAKE2b-256 |
87df6436db84276bac75828b779b6953ecf7d4955aee75a9ad8bdb436cd5175b
|
Provenance
The following attestation bundles were made for aws_audit_mcp-0.2.0.tar.gz:
Publisher:
release.yml on OmniNomadLLC/aws-audit-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aws_audit_mcp-0.2.0.tar.gz -
Subject digest:
3ead28f9f4215dc8e8f58fdaec4cc6250690b05ccc3a727d48a26bf3a9510e9e - Sigstore transparency entry: 2649036627
- Sigstore integration time:
-
Permalink:
OmniNomadLLC/aws-audit-mcp@64fddc42ed59f3ffbefea435caeeae1463f28b3c -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/OmniNomadLLC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@64fddc42ed59f3ffbefea435caeeae1463f28b3c -
Trigger Event:
push
-
Statement type:
File details
Details for the file aws_audit_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: aws_audit_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46182cad859931bf91be6c2969764be3715e3d49379cfe1fbbc2f56d5bfc846e
|
|
| MD5 |
772a6767ddd724ca81c32e77a02d12d1
|
|
| BLAKE2b-256 |
bad0a0cec5b88ce0ff9eeaa4701950435002659f576e0eed0df4bf236221fe74
|
Provenance
The following attestation bundles were made for aws_audit_mcp-0.2.0-py3-none-any.whl:
Publisher:
release.yml on OmniNomadLLC/aws-audit-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aws_audit_mcp-0.2.0-py3-none-any.whl -
Subject digest:
46182cad859931bf91be6c2969764be3715e3d49379cfe1fbbc2f56d5bfc846e - Sigstore transparency entry: 2649036688
- Sigstore integration time:
-
Permalink:
OmniNomadLLC/aws-audit-mcp@64fddc42ed59f3ffbefea435caeeae1463f28b3c -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/OmniNomadLLC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@64fddc42ed59f3ffbefea435caeeae1463f28b3c -
Trigger Event:
push
-
Statement type: