aws-readonly-mcp

aws-readonly-mcp

A read-only MCP server that lets an LLM inspect an AWS account — list EC2 instances, S3 buckets, IAM users, and cost — with a structural guarantee against any mutations.

Category
Visit Server

README

aws-readonly-mcp

A read-only Model Context Protocol (MCP) server that lets an LLM inspect an AWS account — list EC2 instances, S3 buckets, IAM users, and cost — but never mutate it.

Why I built it

When I help teams understand their cloud, I want an LLM that can answer "what's running and what's it costing me?" without any ability to change the account. So the read-only guarantee is structural, not a matter of trusting the model.

Every AWS call routes through a single function that checks the operation name against an allow-list of read-only prefixes (describe*, list*, get*). There is no code path that can Run, Create, Delete, Terminate, or Modify anything. If the model asks for a mutation, the server refuses. Pair it with a read-only IAM policy (e.g. AWS-managed ReadOnlyAccess) for defense in depth — the server enforces it in code, IAM enforces it at the boundary.

What it does

Tool Description
list_ec2_instances EC2 instances in a region: ID, state, type, AZ
list_s3_buckets All S3 bucket names in the account
get_cost_last_30_days Total cost over the last 30 days, grouped by service
describe_iam_user Details for a single IAM user

Quick start

# 1. Install (using uv — https://docs.astral.sh/uv/)
uv sync

# 2. Configure AWS credentials. STRONGLY recommended: use a profile whose IAM
#    role has only ReadOnlyAccess, so even a bug cannot mutate anything.
export AWS_PROFILE=my-readonly-profile
aws sts get-caller-identity   # confirm you're who you expect

# 3. Run the server
uv run aws-readonly-mcp

Connect it to Claude Desktop

{
  "mcpServers": {
    "aws-readonly": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/aws-readonly-mcp", "run", "aws-readonly-mcp"],
      "env": { "AWS_PROFILE": "my-readonly-profile" }
    }
  }
}

Then ask Claude things like "Which services drove my AWS bill last month?" — it calls get_cost_last_30_days, reasons over the breakdown, and explains — but it physically cannot change your account.

Design decisions

  • Allow-list by operation prefix. Read-only AWS operations are Describe*/List*/Get*. I allow those prefixes and reject everything else, so the boundary fails closed.
  • One chokepoint. All boto3 calls go through _aws_call; the security boundary is one auditable function.
  • Defense in depth. The README pushes you toward a ReadOnlyAccess IAM role so there are two independent guarantees (code + IAM), not one.
  • Trimmed responses. Botocore ResponseMetadata is stripped so the model sees only the useful payload, saving tokens.

What I'd do next

  • Add pagination for accounts with many resources.
  • Add a small eval asserting every mutating operation is refused.
  • Support assuming a cross-account read-only role per request.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured