AWS Resources Operations

AWS Resources Operations

Run generated python code to securely query or modify any AWS resources supported by boto3.

22
Stars
15
Forks
0
Releases

Overview

AWS Resources MCP Server provides a sandboxed MCP execution environment that runs pre-generated Python code to query or modify AWS resources using boto3. It exposes a dynamic resource interface named aws://query_resources for performing boto3-based queries. A dedicated tool, aws_resources_query_or_modify, accepts a Python code snippet (which must set a variable named result) and returns the query output as JSON. The system employs AST-based code analysis to validate imports and structure, a restricted execution environment with limited built-ins, and robust error handling to report issues clearly. Results are serialized to JSON with proper handling of AWS-specific objects and datetime values. Prerequisites include AWS credentials (via environment variables such as AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION or an AWS_PROFILE) and optional Docker-based deployment. The README also demonstrates usage through examples (e.g., listing S3 buckets, retrieving the latest CodePipeline deployment) and notes cross-platform publishing via Docker Buildx and Smithery installation. This server targets Python developers and operations teams seeking containerized, sandboxed AWS resource queries and controlled modifications.

Details

Owner
baryhuang
Language
Python
License
MIT License
Updated
2025-12-07

Features

aws_resources_query_or_modify tool

Executes a boto3 code snippet to query or modify AWS resources. Requires setting a result variable and supports a defined set of imports and built-ins.

Dynamic AWS resource interface

Provides access to AWS resources through the dynamic resource aws://query_resources for boto3 operations.

AST-based safety validation

Uses abstract syntax tree analysis to validate imports and code structure before execution.

Restricted execution environment

Runs user code in a sandbox with limited built-ins to enhance safety and isolation.

JSON-serialized results

Outputs query/manipulation results as JSON, with proper handling of AWS objects and datetime values.

Error handling and reporting

Provides robust error reporting to diagnose issues in code snippets and AWS operations.

Audience

OperationsTo securely query and modify AWS resources via boto3 using generated code.

Tags

MCPAWSboto3AWS resourcesPythonDockersandboxsecurityASTJSONcode executiondynamic resourceaws://query_resources