# mcp-server-aws-resources-python

> MCP Server

This repository provides an MCP server that executes Python code to query and manage AWS resources using boto3. It offers a Docker-based, Python-centric alternative to existing solutions, prioritizing stability, ease

## Overview

- **Category:** System Tools
- **Language:** Python
- **Stars:** 24
- **Forks:** 3
- **Owner:** baryhuang
- **GitHub:** https://github.com/baryhuang/mcp-server-aws-resources-python
- **Created:** 2025-01-14T08:41:10+00:00
- **Updated:** 2025-03-22T13:08:21+00:00
- **Source:** https://model-context-protocol.com/servers/mcp-server-aws-resource-management-python

## Setup

## Setup

### Prerequisites

You'll need AWS credentials with appropriate permissions to query AWS resources. You can obtain these by:
1. Creating an IAM user in your AWS account
2. Generating access keys for programmatic access
3. Ensuring the IAM user has necessary permissions for the AWS services you want to query

The following environment variables are required:
- `AWS_ACCESS_KEY_ID`: Your AWS access key
- `AWS_SECRET_ACCESS_KEY`: Your AWS secret key
- `AWS_SESSION_TOKEN`: (Optional) AWS session token if using temporary credentials
- `AWS_DEFAULT_REGION`: AWS region (defaults to 'us-east-1' if not set)

You can also use a profile stored in the `~/.aws/credentials` file. To do this, set the `AWS_PROFILE` environment variable to the profile name.

Note: Keep your AWS credentials secure and never commit them to version control.

### Installing via Smithery

To install AWS Resources MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mcp-server-aws-resources-python):

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

### Docker Installation

You can either build the image locally or pull it from Docker Hub. The image is built for the Linux platform.

#### Supported Platforms
- Linux/amd64
- Linux/arm64
- Linux/arm/v7

#### Option 1: Pull from Docker Hub
```bash
docker pull buryhuang/mcp-server-aws-resources:latest
```

#### Option 2: Build Locally
```bash
docker build -t mcp-server-aws-resources .
```

Run the container:
```bash
docker run \
  -e AWS_ACCESS_KEY_ID=your_access_key_id_here \
  -e AWS_SECRET_ACCESS_KEY=your_secret_access_key_here \
  -e AWS_DEFAULT_REGION=your_AWS_DEFAULT_REGION \
  buryhuang/mcp-server-aws-resources:latest
```

Or using stored credentials and a profile:
```bash
docker run \
  -e AWS_PROFILE=[AWS_PROFILE_NAME] \
  -v ~/.aws:/root/.aws \
  buryhuang/mcp-server-aws-resources:latest
```

## Cross-Platform Publishing

To publish the Docker image for multiple platforms, you can use the `docker buildx` command. Follow these steps:

1. **Create a new builder instance** (if you haven't already):
   ```bash
   docker buildx create --use
   ```

2. **Build and push the image for multiple platforms**:
   ```bash
   docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t buryhuang/mcp-server-aws-resources:latest --push .
   ```

3. **Verify the image is available for the specified platforms**:
   ```bash
   docker buildx imagetools inspect buryhuang/mcp-server-aws-resources:latest
   ```

## Tools

## Available Tools

1.  `aws://query_resources` (A dynamic resource that provides access to AWS resources through boto3 queries)
2.  `query_aws_resources` (Execute a boto3 code snippet to query AWS resources)

