Back to MCP Catalog

AWS Resources Python MCP Server

Cloud PlatformsPython
Execute boto3 code to query and manage AWS resources directly through Claude
Available Tools

aws_resources_query_or_modify

Execute a boto3 code snippet to query or modify AWS resources

code_snippet

AWS Resources Python provides a powerful interface for Claude to interact with AWS services through boto3. This MCP server allows you to execute Python code snippets that can query or modify AWS resources based on your AWS credentials and permissions. With proper sandboxing and containerization, you can safely perform AWS operations without complex setups. The server supports a wide range of AWS services and operations, making it an ideal tool for cloud administrators, developers, and DevOps professionals who want to leverage Claude's capabilities for AWS management.

Overview

AWS Resources Python is a Model Context Protocol (MCP) server that enables Claude to execute Python code using boto3 to interact with AWS resources. This tool allows you to query information about your AWS infrastructure or perform management operations directly through Claude, with the permissions defined by your AWS credentials.

Installation

Prerequisites

Before using this MCP server, you'll need:

  1. AWS credentials with appropriate permissions
  2. Docker installed on your system

Setup with Docker

The easiest way to get started is by using the pre-built Docker image:

docker run -p 8000:8000 \
  -e AWS_ACCESS_KEY_ID=your_access_key \
  -e AWS_SECRET_ACCESS_KEY=your_secret_key \
  -e AWS_DEFAULT_REGION=your_region \
  buryhuang/mcp-server-aws-resources

Replace your_access_key, your_secret_key, and your_region with your actual AWS credentials.

If you're using temporary credentials, you can also include:

-e AWS_SESSION_TOKEN=your_session_token

Alternatively, you can use a profile from your AWS credentials file by setting:

-e AWS_PROFILE=your_profile_name

Setup with Smithery

If you're using Claude Desktop, you can install this MCP server automatically using Smithery:

npx -y @smithery/cli install mcp-server-aws-resources-python --client claude

Usage

Once the server is running, you can use Claude to execute boto3 code snippets. The code must set a result variable that will be returned to Claude.

Example Queries

Here are some examples of what you can do:

  1. List all S3 buckets:
s3 = session.client('s3')
result = s3.list_buckets()
  1. Get EC2 instance information:
ec2 = session.client('ec2')
result = ec2.describe_instances()
  1. Check CloudWatch metrics:
cloudwatch = session.client('cloudwatch')
result = cloudwatch.list_metrics(
    Namespace='AWS/EC2'
)

Available Imports and Functions

The execution environment allows these imports:

  • boto3
  • operator
  • json
  • datetime
  • pytz
  • dateutil
  • re
  • time

And these built-in functions:

  • Basic types: dict, list, tuple, set, str, int, float, bool
  • Operations: len, max, min, sorted, filter, map, sum, any, all
  • Object handling: hasattr, getattr, isinstance
  • Other: print, import

Security Considerations

This MCP server executes Python code with the permissions of your AWS credentials. While it includes safety features like AST-based code analysis and a restricted execution environment, you should be aware that:

  1. The server is not limited to read-only operations by default
  2. Your AWS user role dictates the permissions for what operations can be performed
  3. You should use the principle of least privilege when creating AWS credentials for this tool

For production use, consider creating dedicated AWS credentials with only the permissions needed for your specific use case.

Related MCPs

AWS CLI
Cloud PlatformsPython

Execute AWS CLI commands securely through AI assistants

Kubernetes
Cloud PlatformsGo

Connect to and manage Kubernetes clusters through natural language

Cloudflare
Cloud PlatformsTypeScript

A Model Context Protocol server for Cloudflare services

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.