Skip to main content
Glama
baryhuang

AWS Resources MCP Server

by baryhuang

AWS Resources MCP Server

Docker Hub Docker Hub

Overview

A Model Context Protocol (MCP) server implementation that provides running generated python code to query any AWS resources through boto3.

At your own risk: I didn't limit the operations to ReadyOnly, so that cautious Ops people can be helped using this tool doing management operations. Your AWS user role will dictate the permissions for what you can do.

Demo: Fix Dynamodb Permission Error

https://github.com/user-attachments/assets/de88688d-d7a0-45e1-94eb-3f5d71e9a7c7

Related MCP server: MCP Development Server

Why Another AWS MCP Server?

I tried AWS Chatbot with Developer Access. Free Tier has a limit of 25 query/month for resources. Next tier is $19/month include 90% of the features I don't use. And the results are in a fashion of JSON and a lot of restrictions.

I tried using aws-mcp but ran into a few issues:

  1. Setup Hassle: Had to clone a git repo and deal with local setup

  2. Stability Issues: Wasn't stable enough on my Mac

  3. Node.js Stack: As a Python developer, I couldn't effectively contribute back to the Node.js codebase

So I created this new approach that:

  • Runs directly from a Docker image - no git clone needed

  • Uses Python and boto3 for better stability

  • Makes it easy for Python folks to contribute

  • Includes proper sandboxing for code execution

  • Keeps everything containerized and clean

For more information about the Model Context Protocol and how it works, see Anthropic's MCP documentation.

Components

Resources

The server exposes the following resource:

  • aws://query_resources: A dynamic resource that provides access to AWS resources through boto3 queries

Example Queries

Here are some example queries you can execute:

  1. List S3 buckets:

s3 = session.client('s3')
result = s3.list_buckets()
  1. Get latest CodePipeline deployment:

def get_latest_deployment(pipeline_name):
    codepipeline = session.client('codepipeline')

    result = codepipeline.list_pipeline_executions(
        pipelineName=pipeline_name,
        maxResults=5
    )

    if result['pipelineExecutionSummaries']:
        latest_execution = max(
            [e for e in result['pipelineExecutionSummaries']
             if e['status'] == 'Succeeded'],
            key=itemgetter('startTime'),
            default=None
        )

        if latest_execution:
            result = codepipeline.get_pipeline_execution(
                pipelineName=pipeline_name,
                pipelineExecutionId=latest_execution['pipelineExecutionId']
            )
        else:
            result = None
    else:
        result = None

    return result

result = get_latest_deployment("your-pipeline-name")

Note: All code snippets must set a result variable that will be returned to the client. The result variable will be automatically converted to JSON format, with proper handling of AWS-specific objects and datetime values.

Tools

The server offers a tool for executing AWS queries:

  • aws_resources_query_or_modify

    • Execute a boto3 code snippet to query or modify AWS resources

    • Input:

      • code_snippet (string): Python code using boto3 to query AWS resources

      • The code must set a result variable with the query output

    • Allowed imports:

      • boto3

      • operator

      • json

      • datetime

      • pytz

      • dateutil

      • re

      • time

    • Available 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

Implementation Details

The server includes several safety features:

  • AST-based code analysis to validate imports and code structure

  • Restricted execution environment with limited built-in functions

  • JSON serialization of results with proper handling of AWS-specific objects

  • Proper error handling and reporting

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:

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

docker pull buryhuang/mcp-server-aws-resources:latest

Option 2: Build Locally

docker build -t mcp-server-aws-resources .

Run the container:

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:

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):

    docker buildx create --use
  2. Build and push the image for multiple platforms:

    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:

    docker buildx imagetools inspect buryhuang/mcp-server-aws-resources:latest

Usage with Claude Desktop

Running with Docker

Example using ACCESS_KEY_ID and SECRET_ACCESS_KEY

{
  "mcpServers": {
    "aws-resources": {
      "command": "docker",
      "args": [
        "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"
      ]
    }
  }
}

Example using PROFILE and mounting local AWS credentials

{
  "mcpServers": {
    "aws-resources": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "AWS_PROFILE=default",
        "-v",
        "~/.aws:/root/.aws",
        "buryhuang/mcp-server-aws-resources:latest"
      ]
    }
  }
}

Running with Git clone

Example running with git clone and profile

{
  "mcpServers": {
    "aws": {
      "command": "/Users/gmr/.local/bin/uv",
      "args": [
        "--directory",
        "/<your-path>/mcp-server-aws-resources-python",
        "run",
        "src/mcp_server_aws_resources/server.py",
        "--profile",
        "testing"
      ]
    }
  }
}

Available Tools

1 tool
aws_resources_query_or_modifyC

Execute a boto3 code snippet to query or modify AWS resources

ParametersJSON Schema
NameRequiredDescriptionDefault
code_snippetYesPython code using boto3 to query or modify AWS resources. The code should have default execution setting variable named 'result'. Example code: 'result = boto3.client('s3').list_buckets()'

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool can 'query or modify' AWS resources, implying both read and write operations, but fails to detail critical aspects like authentication requirements, error handling, rate limits, or safety considerations. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded in a single sentence: 'Execute a boto3 code snippet to query or modify AWS resources.' It efficiently conveys the core purpose without unnecessary details, though it could be slightly improved by structuring usage hints separately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (executing arbitrary code for AWS operations) and the absence of annotations and output schema, the description is incomplete. It lacks information on return values, error cases, security implications, and operational constraints, which are crucial for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'code_snippet' parameter well-documented in the schema. The description adds no additional meaning beyond what the schema provides, as it only repeats the boto3 and AWS context. According to the rules, with high schema coverage, the baseline is 3 even without param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Execute a boto3 code snippet to query or modify AWS resources.' It specifies the action (execute), technology (boto3), and target (AWS resources). However, it doesn't distinguish from siblings since there are none, so it cannot achieve the full differentiation required for a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions querying or modifying AWS resources but offers no context about specific scenarios, prerequisites, or exclusions. This lack of usage direction limits its effectiveness for an AI agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev1.0.0
    • First observedaws_resources_query_or_modify

TDQS

B3.1/5.0
Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined as executing boto3 code snippets for AWS operations.

Naming Consistency5/5

Since there is only one tool, naming consistency is inherently perfect. The tool name 'aws_resources_query_or_modify' follows a clear verb_noun pattern and is descriptive.

Tool Count2/5

A single tool for an AWS resources server is too few for the apparent scope, as AWS involves many distinct services and operations. This forces all functionality through one generic interface, which is insufficient for comprehensive coverage.

Completeness2/5

The tool surface is severely incomplete for an AWS resources domain. While the tool allows generic boto3 execution, it lacks specific operations for common AWS resources (e.g., EC2 instances, S3 buckets, IAM roles), leaving significant gaps that will likely cause agent failures.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    C
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with your AWS environment. This allows for natural language querying and management of your AWS resources during conversations. Think of better Amazon Q alternative.
    3
    294
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    A Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.
    9
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/baryhuang/mcp-server-aws-resources-python'

If you have feedback or need assistance with the MCP directory API, please join our Discord server