Containers
Automating AI-assisted container deployments with the Amazon ECS MCP Server
This blog post was jointly authored by Debasis Rath, Senior Solutions Architect – Serverless and Anton Aleksandrov, Principal Solutions Architect – Serverless
Introduction
Containerized applications have become the standard for modern cloud deployments, offering consistent environments, streamlined dependency management and seamless scaling. However, the process of containerizing and deploying applications remains manual and time-consuming. Builders often need to create Dockerfiles, configure networking, allocate compute resources, and manage deployment pipelines. This forces even experienced builders to handle repetitive containerization tasks that could be accelerated with the help of artificial intelligence (AI) assistants such as Amazon Q Developer.
To address this concern, today we’re announcing a Model Context Protocol (MCP) Server for building applications for Amazon Elastic Container Service (Amazon ECS), a new component in the AWS MCP Servers collection that bridges the gap between AI-assisted development and production-ready Amazon ECS deployment best practices. The Amazon ECS MCP Server enables AI assistants, such as Amazon Q Developer, to automatically containerize applications and manage their deployments on to Amazon ECS while leveraging AWS Fargate and Application Load Balancers (ALBs). Although this post focuses on Amazon Q Developer, this MCP Server is designed to work with any AI agent or client that supports the MCP protocol.
This is the first version of the Amazon ECS MCP Server, and we’re just getting started. We plan to extend its capabilities with more best practices and broader functionality over time.
Overview
The Amazon ECS MCP Server provides a robust toolkit for managing containerized applications on AWS. Its functionality is built around the following core categories that span the entire application lifecycle: development, deployment, operations, troubleshooting, and decommissioning. The initial set of tools, an MCP Server primitive, included in the Amazon ECS MCP Server provide application analysis and containerization through to cloud deployment, monitoring, and maintenance.
- Development tools analyze application code to detect languages and frameworks, provides guidance for creating optimized Dockerfiles with appropriate base images and dependencies. These include multi-stage builds and layer optimization for efficient containerization.
- Deployment tools use AWS CloudFormation to provision Amazon ECS environments. These tools handle resource dependencies, create least-privilege AWS Identity and Access Management (IAM) permissions, and monitor deployments through AWS Software Development Kit (AWS SDK) polling.
- Troubleshooting tools include specialized analyzers for each Amazon ECS component. These tools feature log pattern recognition, event stream analysis, failure pattern detection, and a decision tree engine for guided diagnosis.
- Operations tools provide a read-only interface to list and describe Amazon ECS resources such as clusters, services, tasks, and task definitions. They support natural language filtering options and return detailed information about your Amazon ECS infrastructure.
- Decommissioning tools implement dependency-aware deletion ordering with pre-deletion validation. These tools identify stacks through naming patterns and comprehensively track resources to prevent orphaned components.
The MCP server’s architecture is designed to minimize deployment and troubleshooting friction while maintaining security and operational best practices. It interfaces directly with AWS services through AWS SDK and uses CloudFormation for infrastructure provisioning, making sure of consistent and reproducible deployments across different environments.
List of tools available with the Amazon ECS MCP Server
The following tools are available with the Amazon ECS MCP Server to support containerized application development and operations:
Tool name | Type | Utility |
containerize_app | Development | Provides guidance to create docker file |
create_ecs_infrastructure | Deployment | Provisions Amazon ECS infrastructure using CloudFormation |
get_deployment_status | Deployment | Monitors deployment status |
ecs_resource_management | Operations | Manages resource inventory |
ecs_troubleshooting_tool | Troubleshooting | Diagnoses Amazon ECS issues across services and tasks |
delete_ecs_infrastructure | Decommissioning | Helps with resource cleanup |
Walkthrough
When using Amazon Q Developer, you configure MCP servers using the mcp.json
file. You can store it either in your home directory for global use (~/.aws/amazonq/mcp.json
) or in the workspace root (.amazonq/mcp.json
) to share across your team. For detailed instructions on configuring MCP servers for Amazon Q, refer to this blog post.
When it is configured, open the Amazon Q Developer CLI and use the /tools
command to view the list of available tools, as shown in the following figure.

Figure1. Listing available tools for Amazon Q
AI assistance means that managing Amazon ECS resources is as streamlined as asking a question. When you say “How do I deploy my app to AWS?”, Amazon Q interprets it as a deployment request. It invokes the Amazon ECS MCP Server’s analysis capabilities and executes a sequence of tools to containerize, provision, and deploy your application to Amazon ECS. In the next section we can observe the tools involved and how these tools streamline the entire lifecycle of your containerized workloads.
Development and deployment tools
The containerize_app
tool scans the application source code while keeping you informed with messages such as “Analyzing application structure…” and “Creating Docker file…”. It also creates a Docker Compose file that helps you develop and debug your application locally. You can ask follow-up questions such as “What runtime version was detected?” or “Show me the planned container configuration”, as shown in the following figure.
Then, Amazon Q invokes the create_ecs_infrastructure
tool to automate the deployment of your containerized application to Amazon ECS. This tool provisions the necessary AWS infrastructure, such as Amazon Virtual Private Cloud (Amazon VPC), subnets, security groups, IAM roles, and policies. It sets up ECS clusters, task definitions, and services, and configures an ALB to manage incoming traffic. All resources are created using CloudFormation templates. You can tailor the deployment by specifying parameters in your Amazon Q prompt: VPC and subnet settings, CPU and memory allocations, task count, auto scaling options, container ports, environment variables, and health check paths, as shown in the following figure.
You can track deployment progress using prompts such as “How’s my deployment going?” Behind the scenes, Amazon Q calls the get_deployment_status
tool to monitor your Amazon ECS deployment in real time. When the deployment is complete, Amazon Q provides the application URL along with basic health metrics. For continuous updates, you can use commands such as “Update my React app” or questions such as “How is my application performing?” The natural language interface of Amazon Q and the Amazon ECS MCP Server’s automation mean that managing Amazon ECS deployments becomes as intuitive as chatting with an expert DevOps engineer.
The following sequence diagram shows how these components interact:

Figure 4. Logical flow of containerizing, deploying, and cleaning up Amazon ECS infrastructure
Troubleshooting tools
To help diagnose and resolve issues in Amazon ECS environments, the Amazon ECS MCP Server includes a unified diagnostic tool: ecs_troubleshooting_tool
. This tool offers several actions that provide visibility into different layers of your Amazon ECS infrastructure: from infrastructure provisioning to application behavior. Here’s what you can do with this tool:
- Get troubleshooting guidance: Start with a high-level assessment. This action evaluates your Amazon ECS environment and suggests a guided plan based on your deployment state.
- Analyze CloudFormation stack status: Drill into infrastructure-level issues by checking for failed resources and error messages in your CloudFormation stacks.
- Inspect service events: Review Amazon ECS service events to identify service-level misconfigurations or disruptions affecting your applications.
- Diagnose task failures: Identify patterns in failed tasks, such as resource constraints or application errors, to improve reliability and performance.
Operations tools
To help you inspect and understand your Amazon ECS environment, the Amazon ECS MCP Server includes a read-only tool: ecs_resource_management
. This tool provides a centralized view of your Amazon ECS infrastructure and supports natural language queries to help you explore resource configurations without writing custom scripts or logging in to the AWS Management Console. You can do the following with this tool:
- List Amazon ECS resources: Quickly retrieve information about ECS clusters, services, tasks, task definitions, container instances, and capacity providers.
- Describe configurations: Get detailed metadata for each Amazon ECS resource, such as launch types, desired counts, service discovery settings, and task definitions.
- Use natural language filters: Ask questions such as “What services are running in cluster X?” or “Show me tasks using container image Y”, and the tool interprets your query and returns relevant results.
- Improve operational visibility: Understand how Amazon ECS resources relate to each other and confirm that your infrastructure matches expected configurations.
Decommissioning tools
When you’re ready to clean up your environment, you can ask, “Tear down my ECS stack.” Amazon Q responds by invoking the delete_ecs_infrastructure
tool, which safely removes all resources provisioned through the MCP workflow. It makes sure that dependencies are handled correctly and prevents orphaned components, making decommissioning clean, predictable, and low risk.
That’s it! You now have end-to-end support for developing and operating Amazon ECS applications. The suite is compatible with Amazon Q and any AI assistant that supports the MCP protocol. From containerizing and deploying applications to monitoring and troubleshooting, this toolset helps you manage the complete lifecycle of your containerized workloads.
What’s next?
AI assistants, when paired with the Amazon ECS MCP Server, transform how you build, containerize, and deploy to Amazon ECS—using natural language instead of boilerplate configuration. From analyzing code to provisioning infrastructure, it streamlines the entire workflow.
We’ll continue to expand its capabilities and refine existing tools. Have a feature in mind? Add it to the AWS Containers GitHub roadmap and AWS labs MCP repo.
We’ve also developed the Finch MCP Server to support our users’ diverse container management needs. Finch is an open source, client-side container development tool designed for building, running, and managing containers locally. The Finch MCP Server brings a secure, consistent interface to container operations, reflecting our commitment to flexible, enterprise-ready solutions that meet a range of user requirements.
This toolset is designed to get out of your way and let you focus on building. Whether you’re launching a new project or migrating an existing app to containers, this tool helps along with your AI coding assistant to make the process faster and easier.
Go try it out. Start a new Amazon Q Developer session, connect your project, and run a command such as “deploy my-app to Amazon ECS”. You’ll be deploying production-ready containers in minutes.
To learn more, visit the Amazon Q Developer documentation and explore the Amazon ECS Developer Guide.