Get the FREE Ultimate OpenClaw Setup Guide →

mcp -aws-resources-python

A Python-based MCP server that lets Claude run boto3 code to query and manage AWS resources. Execute powerful AWS operations directly through Claude with proper sandboxing and containerization. No need for complex setups - just pass your AWS credentials and start interacting with all AWS services.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio baryhuang-mcp-server-aws-resources-python docker run -i --rm -e AWS_ACCESS_KEY_ID=your_access_key_id_here -e AWS_SECRET_ACCESS_KEY=your_secret_access_key_here -e AWS_DEFAULT_REGION=us-east-1 buryhuang/mcp-server-aws-resources:latest

How to use

This MCP server exposes a dynamic resource aws://query_resources that lets you run Python code using boto3 to query or modify AWS resources. It is designed to be invoked through MCP clients, returning results as JSON, with AWS-specific objects converted to JSON-friendly formats. A built-in tool, aws_resources_query_or_modify, executes user-provided Python snippets which must assign their results to a variable named result. Only a restricted, sandboxed environment is available for safety, including a curated set of imports and built-ins. Typical usage is to supply code that uses boto3 to call AWS services (for example listing S3 buckets or describing EC2 instances) and then return the data via result so the MCP client can serialize it to JSON.

How to install

Prerequisites:

  • Docker installed on your host (Docker Engine 19.03+ recommended)
  • AWS credentials with permissions to the resources you intend to query or modify
  • Optional: AWS_PROFILE if using shared credentials

Option A: Run via Docker (recommended for quick setup)

  1. Pull and run the image with your AWS credentials:
docker run \
  -i \
  --rm \
  -e AWS_ACCESS_KEY_ID=your_access_key_id_here \
  -e AWS_SECRET_ACCESS_KEY=your_secret_access_key_here \
  -e AWS_DEFAULT_REGION=us-east-1 \
  buryhuang/mcp-server-aws-resources:latest

This starts the MCP server container that serves the aws-resources MCP server.

Option B: Install via Smithery (if you specifically want the Python-based workflow)

  1. Ensure Node.js and npm are installed
  2. Install the server with Smithery:
npx -y @smithery/cli install mcp-server-aws-resources-python --client claude
  1. Run the installed server as directed by Smithery/Claude Desktop integration instructions

Note: The README primarily demonstrates a Docker-based deployment. The Python-based implementation relies on boto3 and is containerized for stability. Choose the approach that best fits your environment.

Additional notes

Tips and common issues:

  • Ensure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION are correctly set. If using a profile, you can mount ~/.aws and set AWS_PROFILE accordingly when running the Docker container.
  • The server executes code snippets in a sandboxed environment. Only allowed imports include boto3 and a small set of helpers; attempting disallowed imports will raise an error.
  • Results are serialized to JSON. If you query AWS SDK objects (Paginators, responses with datetime, etc.), the system will convert them to JSON-safe representations.
  • When using Docker, you can customize environment variables or mount AWS credentials via -v ~/.aws:/root/.aws if you prefer AWS_PROFILE-based access.
  • For cross-account governance, prefer creating separate profiles or roles and switching them with environment variables rather than embedding credentials in code.

Related MCP Servers

Sponsor this space

Reach thousands of developers