概要
What is MCP-AWS?
MCP-AWS is an AI-driven application that combines OpenAI Agents with a custom MCP server to manage AWS EC2 instances via natural language commands in the terminal. It is designed for developers who want to provision and terminate EC2 instances using conversational instructions.
How to use MCP-AWS?
- Install Python 3.12+ (or Docker) and set up an AWS IAM role with EC2 permissions.
- Clone the repository and create a
.envfile withAWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_DEFAULT_REGION,OPENAI_API_KEY,AMI_ID,INSTANCE_TYPE,KEY_NAME,SECURITY_GROUP_IDS, andAWS_REGION. - Run the app either via Docker (
docker image build -t my-mcpthendocker container run -it my-mcp) or locally (create a virtual environment withuv, thencd openai-agent/anduv run agent.py). - At the prompt, enter commands such as “Create an EC2 instance” or “Terminate EC2 instance with ID ”.
Key features of MCP-AWS
- Provision EC2 instances using natural language commands
- Terminate EC2 instances by providing their instance ID
- Integrates OpenAI Agents SDK with a custom MCP server
- Supports both Docker and local Python setup
- All AWS configuration passed via environment variables
Use cases of MCP-AWS
- Quickly spin up an EC2 instance without using the AWS Management Console
- Automate the termination of running EC2 instances through conversational prompts
- Learn how to build and integrate custom MCP servers with the OpenAI Agents SDK
- Prototype natural-language-driven AWS resource management for educational purposes
FAQ from MCP-AWS
What does MCP-AWS do?
MCP-AWS leverages OpenAI Agents and a custom MCP server to provision and terminate AWS EC2 instances using natural language commands entered in the terminal.
What are the prerequisites for using MCP-AWS?
You need Python 3.12+ or Docker, an AWS IAM role with EC2 permissions, and a .env file containing AWS credentials, the OpenAI API key, and EC2 configuration variables (AMI ID, instance type, key name, security group IDs, region).
How do I run MCP-AWS?
You can either build and run the Docker container (docker image build -t my-mcp then docker container run -it my-mcp) or set up a local Python environment with uv and run uv run agent.py from the openai-agent/ directory.
What tools does the MCP server provide?
The MCP server exposes two tools: initiate_aws_ec2_instance to create an EC2 instance, and terminate_aws_ec2_instance to terminate an instance by its ID.
Is MCP-AWS production-ready?
No. The README states it is a proof of concept intended for learning purposes only. It cautions about IAM role security and AWS billing risks, and disclaims responsibility for any issues that arise.