IBM TechXchange AWS Cloud Native User Group

AWS Cloud Native User Group

This group focuses on AWS Cloud Native services. All the discussions, blogs and events will be very specific to AWS Cloud.

 View Only

Amazon Q CLI & MCP: from SDLC to Operations

By Rahul Anand posted 16 hours ago

  

Amazon Q CLI with MCP: SDLC to Cloud Operations

1.       1. Introduction

This blog explores the art of the possible by leveraging Amazon Q CLI in combination with the Model Context Protocol (MCP). We dive into how this powerful integration can streamline the development lifecycle and operational workflows of applications on AWS — enabling faster, context-aware, and more efficient cloud development and operations.

What is Amazon Q Developer CLI?

  • Amazon Q Developer CLI is a terminal-based tool that provides AI-powered assistance for developers working with code, AWS services, and cloud infrastructure. It extends the capabilities of Amazon Q Developer beyond the IDE into your command-line workflow.
  • Q Cli provides fast and new agentic coding experience within the CLI.
  • Using Amazon Q Developer on the command line - Amazon Q Developer

What is Model Context Protocol (MCP)

  •      MCP is an open standard, open-source framework introduced by Anthropic in November 2024 to standardize the way where large language models integrate and share data with external tools, systems, and data sources.
  •         Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.

  •          MCP helps you build agents and complex workflows on top of LLMs.

  • MCP Transport Mechanisms: 

Local (STDIO)

Remote (HTTP or SSE)

Uses the STDIO transport mechanism

Uses the Streamable HTTP transport mechanism

Server is run on your local machine (the same place that your MCP host / client is run)

Server is run on a virtual machine/container (NOT the same place that your MCP host / client is run)

https://modelcontextprotocol.io/

2. About:
In this blog, We will walk through building and deploying a microservices-based Online Bookstore application on the AWS EKS (Elastic Kubernetes Service) platform. Along the way, we’ll explore how combining Amazon Q CLI with Model Context Protocol (MCP) can significantly streamline key activities across Day 0 to Day 2 operations — from initial setup and development to deployment, monitoring, and optimization.

Part 1: End-to-End Application Lifecycle Automation using AWS CLI Agents with MCP
This phase demonstrates how AWS CLI Agents integrated with the MCP (Multi-Agent Control Plane) tool can automate the full application lifecycle. Starting from generating a complete technical architecture—including technology stack, architectural diagrams, and AWS cost estimations—the workflow proceeds to automatically update project documentation in Confluence, create relevant JIRA tasks, generate and deploy production-ready application code, and provision the entire stack on AWS EKS with zero manual intervention or environment touchpoints.


Part 2: Intelligent SRE Automation and Incident Management with Q CLI Agents and MCP
In this phase, the focus shifts to Site Reliability Engineering (SRE) automation. Using Q CLI agents with MCP, the system can autonomously detect issues in microservices, perform root cause analysis, apply corrective fixes, and log relevant details in ServiceNow—including creating Knowledge Base articles, incident reports, and change records. The system also builds intelligence over time, offering contextual suggestions or proactive alerts for similar future incidents, ensuring operational resilience and faster MTTR (Mean Time to Resolution).

3. High Level Architecture of running MCP with AWS Q CLI 

4. Let’s Dive In:
Now that we’ve covered the background, let’s dive into the hands-on implementation. We’ll go step by step to see how Amazon Q CLI and MCP can simplify and accelerate each phase of our microservices journey on AWS EKS.

Part 1: End-to-End Application Lifecycle Automation using AWS CLI Agents with MCP

 Development and Deployment of Bookstore Microservices on AWS EKS
In this phase, we’ll develop and deploy the Online Bookstore microservices on AWS EKS using the Amazon Q Developer CLI. Leveraging its agentic capabilities, the Q CLI will interact with multiple MCP servers at various stages of the workflow to perform specific tasks — as illustrated below.

Let’s Dive In with Hands-On Implementation:

    1). In the first step, I’ll use Amazon Q CLI to generate a comprehensive Technical Architecture Diagram (TAD) for my Online Retail Store application. With just a single prompt,           Q CLI coordinates with multiple MCP servers to deliver a complete architectural blueprint that includes:

  •  Technical design details and AWS best practice - (Q will use AWS documentation MCP server to get the best practice on AWS )
  • Comprehensive Architecture Diagram (using AWS Diagram MCP Server)
  • AWS Cost calculations for deploying the application (using AWS Cost MCP Server)

=> Below is a step-by-step illustration of how, with just a single prompt, Amazon Q CLI agents with MCP servers — generates a comprehensive architecture plan. (Architecture diagram, TAD, AWS cost ARR) in HTML format (it can be in any format md, pdf etc, here I am using HTML )

=> The TAD shown here was auto-generated in the previous steps by Q CLI, leveraging multiple MCP Agents—namely, the AWS Documentation MCP, Diagram MCP, and AWS Cost Estimator MCP. Together, these agents collaborated to produce a comprehensive, production-grade TAD. This mirrors a real-world scenario where, prior to application development and deployment, teams typically draft a TAD to define the architecture, technology choices, integration points, and cost projections.

2. Publishing TAD to Confluence via Q CLI Agents
With the TAD now generated and available in the local workspace, the next step is to seamlessly publish it to our Confluence space. Using Q CLI Agents in conjunction with the Confluence MCP Server, we instruct the system to create a new Confluence page titled "Retail Bookstore - TAD", ensuring that architectural documentation is readily accessible to all stakeholders.

3. Automating JIRA Story and Task Creation
After successfully publishing the TAD, we leverage Q CLI Agents with the JIRA MCP Server to automatically create the necessary Epics, User Stories, and Tasks for managing the full application lifecycle. This ensures alignment between architecture planning and agile execution, without any manual effort.

Below illustrations demonstrate the automated creation of Confluence pages and JIRA issues using Q CLI Agents.       

        

4) Code Generation with Q CLI Agents: Application, Tests, and Automation
In this step, I utilized Q CLI Agents to automatically generate the complete application codebase—including backend APIs, frontend UI components, unit tests, and automated test scripts. This showcases one of the core strengths of Q Developer: agentic AI-powered code generation that significantly accelerates development with minimal human intervention.

The generated code for the Retail Bookstore application includes fully functional backend services, a user-friendly frontend, and comprehensive test coverage to ensure quality and reliability.

          
5) Publishing Code to GitHub via Q CLI Agents
Once the application code was fully developed, reviewed, and tested, I instructed Q CLI Agents to publish the code to GitHub using the GitHub MCP Server. The agents created a new repository and committed the code under a dedicated feature branch, following best practices for version control and collaborative development.
6. Zero-Touch Deployment to AWS EKS using Q CLI Agents
Finally, I leveraged Q CLI Agents in conjunction with the AWS MCP Server to deploy the complete Bookstore application on Amazon EKS (Elastic Kubernetes Service). The entire deployment process was executed in a fully automated, zero-touch manner—no manual environment configuration or intervention required.
Below is the live deployment view of my bookstore microservices application, fully managed and deployed by Q CLI Agents on AWS.
Part 2: Intelligent SRE Automation and Incident Management with Q CLI Agents and MCP

Envisioning AI-Driven Operations: How Q Developer CLI with MCP Transforms Ops Teams
Imagine a future-ready Ops environment where the Q Developer CLI, empowered by MCP Agents, serves as an intelligent co-pilot for your Operations team—automating and simplifying complex workflows using natural language. Here's how it enhances day-to-day operational efficiency:

  • Natural Language-Based Daily Ops: Easily perform routine operational tasks like checking the health of EKS clusters, monitoring microservices, or verifying logs—simply by typing natural language commands.

  • 🔍 Intelligent Issue Detection & RCA: With a single prompt, Q CLI can analyze system behavior, identify issues, and provide a clear Root Cause Analysis without manual log diving.

  • 🛠️ Autonomous Issue Resolution: Once the problem is detected, Q CLI Agents can proactively fix issues on behalf of the Ops team, reducing mean time to resolution (MTTR).

  • 📑 ServiceNow Integration: Automatically log incidents, create change requests, and publish Knowledge Base Articles (KBAs) directly in ServiceNow, keeping ITSM workflows fully aligned.

  • 🧠 Context-Aware Resolution Using Historical Insights: In the case of recurring issues, the system refers to past incident records to recommend resolutions or prevent future occurrences.

Natural Language-Based Daily Ops:

The following illustrations demonstrate how Q CLI, in conjunction with MCP, can effectively assist in routine Ops tasks

  • 🔍 Intelligent Issue Detection & RCA: With a single prompt, Q CLI can analyze system behavior, identify issues, and provide a clear Root Cause Analysis without manual log diving.a). Imagine a scenario where the Ops team receives a critical alert regarding our bookstore microservice application —specifically, that the "Browse Books" tab is unresponsive or failing to load. 
  • Let’s initiate Root Cause Analysis (RCA) using Q CLI Agents with a simple natural language prompt.          
2, The agents first analyzed all microservices and inspected the pod logs, revealing that the catalog service was unable to establish communication with the RDS instance.
3. I initially instructed Q CLI to restart the Catalog Service; however, the issue persisted.
Post-restart, the pod entered a Pending state instead of running, indicating a deeper infrastructure-level problem. Recognizing this, Q CLI agents automatically initiated the next round of diagnostics to further investigate the underlying cause.
Q CLI then executed a resource usage analysis using the kubectl top command to inspect pod-level CPU and memory consumption.
It found the issue, the requested by the pods were more then the available  CPU on Node.
Detailed Root Cause Analysis
🛠️ Intelligent Issue Resolution
Once the RCA is found, It has given me options .. (interesting part is it has also checked my application actual usage was less but there was over commitment of CPU request from POD , option 2)
Finally, I selected Option 2—since this was a PoC application—and Q CLI automatically adjusted the pod's CPU request and limit configurations.
This change resolved the resource scheduling issue, and the application was successfully brought back to a fully running state—without any manual intervention.
  • 📑 ServiceNow Integration: Automatically log incidents, create change requests, and publish Knowledge Base Articles (KBAs) directly in ServiceNow, keeping ITSM workflows fully aligned.I used Q Cli to create summary of the above issue and create KBA article in servicenow using SNOW MCP for future reference tracing, also create incident and chang request.
  • Incident

  • 🧠 Context-Aware Resolution Using Historical Insights: In the case of recurring issues, the system refers to past incident records to recommend resolutions or prevent future occurrences.

  • Now imagine a different user encounters a similar issue on another day.
    They ask Q CLI if a similar incident has occurred in the past—and, leveraging its historical context and ServiceNow integration, Q CLI retrieves the previous incident record, including:

    • The Root Cause Analysis (RCA) from the earlier case

    • The resolution options that were suggested

    • The exact fix that was applied

    • Any associated Knowledge Base Article (KBA) or Change Request logged in ServiceNow

    This enables the user to quickly understand the issue, apply a proven..

  • Q Cli finds below Incidents as similarity search ..

Resolution Recommendations: 

 Conclusion: Q CLI with MCP proves to be a powerful enabler for both SDLC and Ops, delivering end-to-end intelligence, and efficiency across the application lifecycle.

0 comments
5 views

Permalink