
MCP-AWS
A custom server with tools that enable AI agents to provision and terminate AWS EC2 instances through natural language commands.
README
🚀 MCP-AWS: AI Agent for AWS EC2 Management
Welcome to MCP-AWS, a simple yet powerful AI-driven application that leverages OpenAI Agents and MCP servers to manage AWS EC2 instances. This app allows you to provision and terminate EC2 instances using natural language commands in your terminal. 🖥️✨
🎥 Demo Video
Watch the demo video to see MCP-AWS in action! 🚀
🌟 Features
- Provision EC2 Instances: Just tell the AI agent to create an EC2 instance, and it will handle the rest, providing you with the instance ID. 🛠️
- Terminate EC2 Instances: Provide the instance ID, and the agent will terminate the instance for you. ❌
- MCP Server Integration: Explore how custom MCP servers can be created and integrated with OpenAI Agents SDK. 🧩
🛠️ Tools in the MCP Server
The MCP server is a custom server with two tools:
initiate_aws_ec2_instance
: Creates an AWS EC2 instance.terminate_aws_ec2_instance
: Terminates an AWS EC2 instance by its ID.
🚀 Getting Started
Prerequisites
- Python 3.12+ (for local setup) or Docker (for containerized setup)
- AWS IAM Role: Create an IAM role with the necessary permissions to manage EC2 instances.
- Environment Variables: Prepare a
.env
file with the following variables:AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION
OPENAI_API_KEY
AMI_ID
INSTANCE_TYPE
KEY_NAME
SECURITY_GROUP_IDS
AWS_REGION
🏃♂️ Running the App
- Clone the repository:
git clone https://github.com/anirban1592/mcp-server-aws.git cd mcp-aws
- Create
.env
file as shown in prerequisites
Option 1: Docker Setup (Recommended)
- Build the Docker image:
docker image build -t my-mcp .
- Run the container:
docker container run -it my-mcp
Option 2: Local Setup
-
Create and activate virtual environment:
pip install uv uv venv .venv # Windows .venv\Scripts\activate # Unix/MacOS source .venv/bin/activate
-
Run the application:
cd openai-agent/ uv run agent.py
💬 Using the AI Agent
-
To create an EC2 instance:
Enter your command: Create an EC2 instance
-
To terminate an EC2 instance:
Enter your command: Terminate EC2 instance with ID <instance-id>
⚠️ Word of Caution
- IAM Role and Credentials: Please create AWS IAM roles and credentials at your own risk. Ensure you follow AWS best practices for security.
- Billing and Security: This app is a proof of concept (POC) and is intended for learning purposes only. We are not responsible for any billing issues or security incidents.
📚 Learnings
This project demonstrates:
- How to integrate MCP servers with OpenAI Agents SDK
- How to build a simple AI-driven application for AWS resource management
Enjoy exploring the power of AI and MCP servers! 🌟
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.