aws_ec2_orchestrator_via_mcp
Facilitate automated orchestration of Amazon Elastic Compute Cloud (EC2) virtual machine lifecycle events—specifically creation and decommissioning—through natural language inputs managed by the Model Context Protocol (MCP) infrastructure, enabling multi-agent coordination.
Author

anirban1592
Quick Info
Actions
Tags
💻 Orchestration Framework: Interoperability POC (A2A & MCP)
Proof-of-Concept: Merging Agent-to-Agent (A2A) communications, the Model Context Protocol (MCP), and sophisticated OpenAI language models for managing Amazon Web Services (AWS) infrastructure tasks. 🌩️🔑
🎬 Showcase Video
Witness the operational flow of this MCP-AWS utility firsthand!
✨ Key Capabilities
-
Protocol Interoperability: Establishes a successful conduit between the Agent-to-Agent (A2A) messaging standard and an MCP middleware layer, ensuring dependable, structured communication among autonomous entities.
-
Intelligent Model Foundation: Utilizes the OpenAI Agents Software Development Kit (SDK) to power agents with advanced comprehension and execution abilities based on user textual directives.
-
Cloud Resource Automation: Permits the direct instantiation and subsequent deletion of AWS EC2 compute instances via straightforward conversational commands, highlighting practical function invocation through the MCP structure.
🔧 Exposed Functions within the MCP Endpoint
The central MCP service exposes two distinct operational routines:
1. initiate_aws_ec2_instance: Executes the launch sequence for a new AWS EC2 virtual machine.
2. terminate_aws_ec2_instance: Handles the secure shutdown and removal of an EC2 instance, identified by its unique identifier.
🚀 Deployment Guide
Prerequisites for Local Execution
- Runtime Environment: Python version 3.12 or newer, or readiness for containerized execution via Docker.
- AWS Identity: A properly configured Identity and Access Management (IAM) role granting necessary EC2 management privileges.
- Configuration File (
.env): Must contain the following environment parameters:AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_DEFAULT_REGIONOPENAI_API_KEYAMI_ID(Amazon Machine Image Identifier)INSTANCE_TYPE(e.g., t2.micro)KEY_NAME(SSH Key Pair name)SECURITY_GROUP_IDS(List of security groups)AWS_REGION
🏃♂️ Startup Sequence
-
Acquire the source repository at the project root: bash git clone https://github.com/anirban1592/google_openai_mcp.git cd google_openai_mcp
-
Populate the required environment variable definitions in the
.envfile. -
Start the remote operative component: bash cd openai-agent/ uv run .
-
Integrate the Google-provided A2A client source code into the root directory structure: bash git clone https://github.com/google/A2A.git cd demo/ui
-
Establish a dedicated environment file for the client-side key, or input the credentials when prompted by the user interface: bash echo "GOOGLE_API_KEY=your_api_key_here" >> .env
-
Launch the graphical user interface component: bash uv run main.py
-
Consult the accompanying video guide for a demonstration of the integrated functionality.
💬 Interacting with the Cognitive Agent
-
For EC2 instantiation requests:
User Input: Provision a new compute instance on AWS.
-
For EC2 decommissioning actions:
User Input: Retire the virtual machine identified by ID
🛑 Security and Operational Advisory
- Credential Management: Exercise extreme diligence when generating and managing AWS IAM credentials. Adhere strictly to the principle of least privilege and AWS security recommendations.
- Scope Limitation: This application serves purely as an experimental Proof-of-Concept (POC) for educational exploration. We assume no liability for associated infrastructure expenditures or security exposures arising from its deployment.
📚 Knowledge Synthesis
This exercise provides practical insight into: 1. Integrating MCP servers effectively with the capabilities offered by the OpenAI Agents SDK. 2. Architecting a foundational, AI-driven utility for supervising and manipulating core cloud infrastructure assets (AWS).
We encourage thorough experimentation with the integration of artificial intelligence paradigms and MCP architectures! ✨
WIKIPEDIA: Cloud computing, as defined by ISO, represents "a paradigm for enabling network access to a scalable and elastic pool of shareable physical or virtual resources with self-service provisioning and administration on-demand." Colloquially, this concept is often shortened to "the cloud".
== Defining Attributes == In 2011, the United States National Institute of Standards and Technology (NIST) formalized five indispensable attributes required for a system to qualify as cloud-based. The precise NIST definitions are documented as follows:
On-demand self-service: "A consumer can unilaterally provision computing capabilities, such as server time and network storage, as needed automatically without requiring human interaction with each service provider." Broad network access: "Capabilities are available over the network and accessed through standard mechanisms that promote use by heterogeneous thin or thick client platforms (e.g., mobile phones, tablets, laptops, and workstations)." Resource pooling: " The provider's computing resources are pooled to serve multiple consumers using a multi-tenant model, with different physical and virtual resources dynamically assigned and reassigned according to consumer demand." Rapid elasticity: "Capabilities can be elastically provisioned and released, in some cases automatically, to scale rapidly outward and inward commensurate with demand. To the consumer, the capabilities available for provisioning often appear unlimited and can be appropriated in any quantity at any time." Measured service: "Cloud systems automatically control and optimize resource use by leveraging a metering capability at some level of abstraction appropriate to the type of service (e.g., storage, processing, bandwidth, and active user accounts). Resource usage can be monitored, controlled, and reported, providing transparency for both the provider and consumer of the utilized service. By the year 2023, the International Organization for Standardization (ISO) had evolved and expanded this initial categorization.
== Genesis of the Concept ==
The conceptual genesis of distributed computing services can be traced back to the 1960s, marked by the popularization of time-sharing concepts through Remote Job Entry (RJE) systems. During this epoch, the dominant operational model centered around the "data center," where users submitted tasks to specialized operators who executed them on powerful mainframe computers. This period was characterized by intensive investigation and pioneering efforts to democratize access to large-scale computational power via time-sharing, striving for peak infrastructure, platform, and application optimization, thereby boosting end-user efficiency. The specific metaphorical representation of a "cloud" for describing virtualized services emerged in 1994. It was utilized by General Magic to delineate the conceptual space of "locations" accessible by mobile agents operating within the Telescript framework. The attribution for this metaphor is often given to David Hoffman, a communications specialist at General Magic, whose choice was informed by its established usage within telecommunications and network contexts. The term "cloud computing" gained significant public traction in 1996 when Compaq Computer Corporation drafted a strategic business blueprint for forthcoming computational paradigms and internet integration. The firm's primary objective was to significantly advance...

