Execute a boto3 code snippet to query or modify AWS resources
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.
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.
Before using this MCP server, you'll need:
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
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
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.
Here are some examples of what you can do:
s3 = session.client('s3')
result = s3.list_buckets()
ec2 = session.client('ec2')
result = ec2.describe_instances()
cloudwatch = session.client('cloudwatch')
result = cloudwatch.list_metrics(
Namespace='AWS/EC2'
)
The execution environment allows these imports:
And these built-in functions:
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:
For production use, consider creating dedicated AWS credentials with only the permissions needed for your specific use case.