
一台基于Python的MCP服务器,允许Claude运行boto3代码以查询和管理AWS资源。通过适当的沙箱和容器化,直接通过Claude执行强大的AWS操作。
概览
一个模型上下文协议(MCP)服务器实现,提供运行生成的 Python 代码,通过 boto3 查询任何 AWS 资源。 : 我没有将操作限制在ReadyOnly,这样谨慎的运维人员也能用这个工具来做管理操作。你的AWS用户角色将决定你能做什么的权限。 https://github.com/user-attachments/assets/de88688d-d7a0-45e1-94eb-3f5d71e9a7c7 我试过带开发者访问权限的AWS聊天机器人。免费层次限制为每月25次资源查询。下一层是每月19美元,包含我90%不使用的功能。结果以JSON格式和大量限制呈现。 我尝试使用aws-mcp,但遇到了一些问题: 1. : 必须克隆一个 git 仓库并处理本地安装 2.: 我的 Mac 不够稳定 3.: 作为 Python 开发者,我无法有效地回馈 Node。
概述(AI 翻译)
概述
一个模型上下文协议(MCP)服务器实现,提供运行生成的 Python 代码,通过 boto3 查询任何 AWS 资源。
风险自负: 我没有将操作限制在ReadyOnly,这样谨慎的运维人员也能用这个工具来做管理操作。你的AWS用户角色将决定你能做什么的权限。
演示:修复Dynamodb权限错误
https://github.com/user-attachments/assets/de88688d-d7a0-45e1-94eb-3f5d71e9a7c7
为什么要再选一个AWS MCP服务器?
我试过带开发者访问权限的AWS聊天机器人。免费层次限制为每月25次资源查询。下一层是每月19美元,包含我90%不使用的功能。结果以JSON格式和大量限制呈现。
我尝试使用aws-mcp,但遇到了一些问题:
- 设置麻烦:不得不克隆一个git仓库并处理本地安装
- 稳定性问题:我的Mac不够稳定
- Node.js Stack:作为Python开发者,我无法有效地回馈Node.js代码库
于是我创造了这个新方法:
- 直接从Docker镜像运行——无需git克隆
- 使用 Python 和 boto3 以提升稳定性
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
AWS Resources MCP Server
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
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:
- Setup Hassle: Had to clone a git repo and deal with local setup
- Stability Issues: Wasn’t stable enough on my Mac
- 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:
- List S3 buckets:
s3 = session.client('s3')
result = s3.list_buckets()
- 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']
安装
docker 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配置
{
"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"
]
}
}
}