AWS Builder Center
I built an MCP that walks AWS attack paths without sending your resource IDs to the LLM

I built an MCP that walks AWS attack paths without sending your resource IDs to the LLM

An MCP server that turns a live AWS account into a graph, then ranks attack paths by exploit difficulty, measures blast radius, and simulates a fix's impact before you apply it. All resource IDs are tokenized locally, so the model reasons over your infrastructure without ever seeing the real ARNs

The gap >
An AI assistant can read your entire codebase, but ask it "is my AWS account actually exploitable right now?" and it's guessing. It can't see your live cloud, and it can't see how 47 resources connect. Checklist scanners don't help either "SG has port 22 open" is true but says nothing about whether anything's attached, whether that box holds credentials, or whether those credentials reach data. A finding without a path is noise with a severity label.
  
So I built an MCP server that turns a live account into a graph and gives the assistant deterministic tools to interrogate it. The engine does the math; the assistant does the talking. Here's what it can do with real output from a public demo account throughout.
  
The powers >
1. Scan turn a live account into a graph
One call assumes a read-only role, pulls 16+ AWS services, and builds a directed graph. Real demo output:
47 resources · 48 nodes · 72 edges
risk score 3/100 (CRITICAL) · 12 critical · 17 moderate findings
edges: 16 can_access · 10 uses_security_group · 7 attached_to_instance · 4 REACHES …
  
Nodes are resources (plus an INTERNET pseudo-node); edges are relationships. Now "is this exploitable?" becomes "is there a path from INTERNET to something sensitive?" — a question graphs answer well.
2. Verify fix prove it before touching AWS >
  
The strongest power. It clones the graph, applies the change, re-runs every rule, and diffs — no LLM in the loop, fully deterministic. Real output for closing SSH on SG_008:

findings_removed:      SSH port 22 open to internet (Critical)
toxic_combos_resolved: SSH_OPEN_NO_GUARDDUTY
 score_before: 3 → score_after: 32   (delta +29)   safe_to_apply: true
  
"This moves your score from 3 to 32 and resolves a toxic combo" is something you can act on. "This might help" isn't.
3. Simulate a breach full kill chain >
  
Ask "show me the worst attack path" and it returns the staged walkthrough in the screenshot: source → entry → foothold → lateral movement, MITRE technique per step, plus the detection layer (CloudTrail/GuardDuty off = the whole path is walkable with zero logging). Context-aware severity lives here too public S3 behind CloudFront gets downgraded, but SSH-open plus GuardDuty-off gets escalated into a toxic combo:
  
CRITICAL  toxic combo: SSH Open to Internet + GuardDuty Disabled
"brute-force your servers with zero detection capability"
4. Attack paths weighted by exploit difficulty, not hop count
  
Reaching a box through an open port is not the same effort as stealing and replaying IAM credentials, so edges are weighted (0 = free pivot, 1 = trivial network reach, 3 = needs a shell) and it runs weighted Dijkstra from the internet. A 5-hop trivial path can outrank a 2-hop credential-theft path hop count gets that backwards. Real path:
  
CRITICAL  SSH port 22 open to 0.0.0.0/0
SG_008 → EC2_002 → iam-role-NAME_115 → NAME_083 (S3)
exploit distance: 1 hop · blast radius: 10 · MITRE T1021.004
  
5. Blast radius + chokepoints >
For any node it computes what else becomes reachable once you land there. In the demo, the SSH-open EC2 gave blast radius 10, but a Lambda with AdministratorAccess gave 27 — the loudest finding wasn't the worst one. It also run Brandes' betweenness centrality to find chokepoints: EC2_002 had the highest centrality (~0.098), meaning it sits on the most internet→data routes. Harden that one node and the most paths collapse at once.
  
6. Findings + Compliance >
  
List findings filtered by severity, and map the account against CIS AWS Foundations 1.5 and SOC 2 per-control pass/fail, each failure tied to the findings that triggered it, all mapped to MITRE ATT&CK.
  
7. Setup help >
Chat has no "click here" button, so first run hands you a one-click CloudFormation link to create the read-only role. Self-healing: an invalid role ARN routes the assistant back to this tool.
  
The part I care most about: real IDs never reach the model >
Look at the screenshot again every node is SG_001, EC2_001, NAME_074, not sg-0a1b2c3d or acme-customer-pii. Resource IDs are tokenized locally before anything reaches the LLM; the mapping stays on your machine and is never transmitted. Say "fix SG_001" and the tooling resolves the real ID locally, does the work, re-tokenizes the response.
Structure (paths, severity, blast radius) all still work; the sensitive strings stay home. That's what lets paranoid teams banks, healthcare, gov actually use an AI on their cloud.
  
Why an MCP (not a dashboard) >
The host assistant (Claude Desktop / Cursor / Kiro / Cline / Continue) is already the AI. The MCP just exposes these deterministic tools for it to call no second LLM in the path, so the engine stays a calculator and the reasoning stays with the assistant you already trust.
  
Try the exact scan from this post >
Public demo account fake infra, real engine:
role ARN:  arn:aws:iam::194722410583:role/EmfirgeReadOnly
region:    us-east-1
Try it / read the code >
- Source (graph engine, rules, MCP): github.com/theanshsonkar/emfirge
- Install into your assistant: npx @emfirge/mcp install
- Demo scan (fake infra, real engine): role arn:aws:iam::194722410583:role/EmfirgeReadOnly, region us-east-1
- Visual version in a browser: emfirge.cloud
Point the MCP at it and ask for "the worst attack path."
Built by me a student who is just exploring ideas and the space.
Not affiliated with or endorsed by AWS; demo data is synthetic.
I want feedback from people who run AWS security at scale tell me where the graph model breaks.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article