To verify that everything is working correctly, generate a simple serverless function. Start the Amazon Q CLI chat interface and verify the output shows MCP servers being loaded and initialized:
The message in the preceding screenshot might not match what you see for your use case, especially when your MCP servers take longer to load.
Now that you’ve confirmed your environment is properly configured, you can begin exploring the serverless development workflow. The first step in this journey is making informed architectural decisions that will shape your application.
The architecture and design phase is where your serverless application takes shape. Making the right decisions at this stage can significantly impact your project’s success, scalability, and maintainability. The AWS Serverless MCP server provides powerful tools to guide these critical early decisions.
When starting a new serverless project, choosing the right infrastructure as code (IaC) approach is crucial for long-term success. The AWS Serverless MCP server’s get_iac_guidance_tool
transforms this decision-making process from hours of research into a simple conversation. This powerful tool provides comprehensive, contextual guidance tailored to your specific needs by analyzing factors such as:
Let’s see how this works in practice by asking Amazon Q about the best IaC approach for your serverless application:
Because Amazon Q is using get_iac_guidance
for the first time, it will ask you to enter t to trust this tool for the entire session, y to allow the execution of this tool only one time, or n to reject the execution of this tool.
The following example is for an ecommerce application.
After approving the tool usage, you will receive a comprehensive, contextual response tailored to your specific architecture needs. For example:
Development acceleration phase
After you’ve made key architectural decisions, you enter the development phase. This is often the most time-consuming part of the process, requiring significant effort to implement patterns correctly, handle edge cases, and follow best practices. The AWS Serverless MCP server provides tools that dramatically accelerate this phase by using proven patterns and templates.
The get_serverless_template
tool alleviates the need to start from scratch by providing access to production-ready serverless patterns from the AWS Serverless Land GitHub repository. These patterns are tested, follow AWS best practices, and can be customized to meet your specific requirements.
Let’s say you want to understand more about serverless architecture. With this tool, you can discover and implement common serverless architectures with a simple conversation. For example, you can ask Amazon Q the following question:
Show me Node.js API templates for serverless applications
Because Amazon Q is using get_serverless_templates
for the first time, it will ask you to enter t
to trust this tool for the session, y
to trust the tool only for this time, or n
to reject the use of this tool.
You will have to trust at least this tool if not more. After trusting the tool, you should get a response similar to the following:
Development and testing phase
The development and testing phase is where your serverless application takes shape through code. This phase requires tools that streamline the creation, building, and testing of your application components. The AWS Serverless MCP server provides a suite of tools that integrate seamlessly with the AWS SAM CLI, enabling a smooth development experience from project initialization to local testing.
Beginning a new serverless project with the right structure and configuration can be challenging. The sam_init
tool reduces this hurdle by creating well-structured projects that follow AWS best practices out of the box. This tool provides templates for various serverless application types, helping you start with a solid foundation.
For example, you can ask the following question:
Create a new SAM project for a Python REST API
Because Amazon Q is using sam_init
for the first time, it will ask you to enter t
to trust this tool for the session, y
to trust the tool only for this time, or n
to reject the use of this tool.
The sam_init
tool is used to initialize a new serverless application using AWS SAM. It creates a complete project structure with the necessary files to develop, test, and deploy serverless applications on AWS.
The tool has the following key capabilities:
- It creates a new project directory with a standardized structure for serverless applications
- It generates an AWS SAM template file (
template.yaml
) that defines your infrastructure as code - It sets up the initial code for Lambda functions in your chosen runtime (Python, Node.js, and so on)
- It configures the project with the appropriate dependency management system
For your ecommerce microservices architecture, this tool would be particularly useful for:
- Creating individual microservices (like your product catalog service or payment service)
- Setting up serverless API endpoints through API Gateway
- Establishing the foundation for event-driven communication between services
The tool supports various application templates and runtimes, helping you quickly bootstrap different types of serverless applications, from simple APIs to more complex event-processing systems.
Deployment and configuration phase
After you have developed and tested your serverless application locally, the next step is deploying it to the AWS Cloud. This phase often involves complex, multi-step processes to make sure the components are properly deployed, configured, and integrated. The AWS Serverless MCP server provides specialized tools that simplify these processes, enabling smooth deployments with minimal manual intervention.
Streamline full-stack deployments
For this use case, we’re building a full-stack serverless application with a React frontend, Node.js backend APIs, and DynamoDB database. Traditionally, this would require manually configuring multiple AWS services, managing deployment pipelines, and validating proper integration between components.
The webapp_deployment_help
tool transforms this complex process into a single, streamlined operation that handles the different aspects of deployment while following AWS best practices.
You can ask Amazon Q the following question:
Deploy my React application to AWS with serverless backend
Because Amazon Q is using webapp_deployment_help
for the first time, it will ask you to enter t
to trust this tool for the session, y
to trust the tool only for this time, or n
to reject the use of this tool. For this example, trust this tool for the session.
This tool supports three deployment types:
- Backend only – Deploys a backend application to Lambda with API Gateway
- Frontend only – Deploys a frontend application to Amazon Simple Storage Service (Amazon S3) and Amazon CloudFront
- Full stack – Deploys both backend and frontend components together
It uses AWS Lambda Web Adapter, so you can deploy standard web applications (like Express.js, Flask, and React) to Lambda without needing to modify your code to follow Lambda-specific conventions.
For your ecommerce microservices architecture, this tool is particularly useful because it aligns with several components in your diagram:
- It can deploy your frontend to CloudFront
- It can deploy your microservices as Lambda functions or containers
- It integrates with API Gateway for API management
The tool requires you to build your application first using your framework’s build command (like npm run build
for React), then it handles the deployment to AWS, including setting up the necessary infrastructure.
Set up custom domains
Although your application is now deployed and accessible using AWS generated URLs, professional applications typically require branded, custom domain names for a better user experience. However, configuring custom domains traditionally involves multiple complex steps across several AWS services. The configure_domain
tool simplifies this process into a single, intuitive conversation.
You can ask Amazon Q the following question:
Configure my custom domain example.com for my serverless application
Because Amazon Q is using configure_domain
for the first time, it will ask you to enter t
to trust this tool for the session, y
to trust the tool only for this time, or n
to reject the use of this tool.
Get the steps to configure your domain as follows:
The tool orchestrates a comprehensive domain setup process that includes the following steps:
- Creating and validating AWS Certificate Manager (ACM) certificates for secure HTTPS connections
- Configuring Amazon Route 53 DNS records to point to your application
- Setting up API Gateway custom domain mappings
- Associating CloudFront distributions with your domain
- Establishing proper cache behaviors and security settings
This automation alleviates the need to navigate between multiple AWS console pages and services, reducing the risk of configuration errors while making sure your domain setup follows security best practices. The tool also handles the complexities of certificate validation and DNS propagation, providing clear guidance throughout the process.
With configure_domain
, you can transform your application’s user experience from generic AWS endpoints to professional, branded domains in minutes rather than hours.
Having walked through the complete serverless development lifecycle—from architecture decisions to deployment and configuration—we can now appreciate the transformative impact of Amazon Q CLI with MCP on the entire process.
Next steps
To continue your serverless journey with Amazon Q CLI and MCP, we recommend a progressive approach to building your expertise:
- Begin with a simple project like a basic Lambda function triggered by an API Gateway endpoint or Amazon S3 event to familiarize yourself with the conversational development workflow and gain confidence in the generated solutions.
- Explore different serverless patterns by experimenting with event-driven architectures using EventBridge for decoupled communication, orchestration workflows with AWS Step Functions, or building comprehensive API-backed applications with API Gateway and Lambda.\
- As your applications mature, integrate the generated code into your continuous integration and deployment pipelines using services like AWS CodePipeline or AWS CodeBuild to automate testing and deployment processes.
- Enhance your applications with robust observability by implementing monitoring, logging, and tracing using Amazon CloudWatch, AWS X-Ray, and Powertools for AWS Lambda (Python) to gain insights into performance and troubleshoot issues effectively.
- Share your experiences and suggestions with the community to contribute to the improvement of MCP servers and help shape the future of AI-assisted serverless development.
Conclusion
By using Amazon Q CLI with MCP servers, you can accelerate your serverless application development while adhering to AWS best practices. This approach helps you focus on your business logic while Amazon Q handles the implementation details, resulting in more robust, scalable, and secure applications.
The ability to generate code, configurations, and architecture recommendations in minutes rather than hours creates a comprehensive development experience that makes sure the different components adhere to best practices while providing actionable, specific implementation guidance. The iterative nature of this approach helps teams quickly compare different architectural decisions through simple prompts, while continuously validating their implementations against official AWS documentation.
Having explored the capabilities and benefits of this approach, you’re now ready to apply these concepts in your own projects.
As you continue exploring serverless application development with Amazon Q CLI and MCP, we encourage you to deepen your knowledge with the following resources:
- The MCP documentation provides valuable insights into how MCP enhances the capabilities of Amazon Q beyond basic interactions.
- The AWS SAM documentation offers comprehensive guidance for serverless application development patterns and deployment strategies.
- To learn more about Amazon Q CLI, refer to Using Amazon Q Developer on the command line.
- When focusing on architectural excellence, the AWS Well-Architected Framework provides foundational principles for implementing security, reliability, performance efficiency, cost optimization, and operational excellence.
- For serverless-specific architectural guidance that addresses the unique characteristics of this computing model, refer to the specialized Serverless Lens for Well-Architected Framework tailored specifically for serverless applications.
- To enhance your development workflow, Powertools for AWS Lambda (Python) offers ready-to-use utilities for structured logging, metrics collection, and distributed tracing. Additionally, the AWS MCP servers documentation offers domain-specific assistance tailored to your project requirements.
- The serverless community provides valuable resources through AWS Serverless Land, a curated collection of serverless resources, patterns, and examples, and Serverless Stack, an open source framework for building production-ready serverless applications with integrated best practices.
Start building your next serverless application with Amazon Q CLI and MCP today.
About the authors
Dunieski Otano is a Solutions Architect at Amazon Web Services based out of Miami, Florida. He works with World Wide Public Sector MNO (Multi-International Organizations) customers. His passion is Security, Machine Learning and Artificial Intelligence, and Serverless. He works with his customers to help them build and deploy high available, scalable, and secure solutions. Dunieski holds 14 AWS certifications and is an AWS Golden Jacket recipient. In his free time, you will find him spending time with his family and dog, watching a great movie, coding, or flying his drone.
Varun Jasti is a Solutions Architect at Amazon Web Services, working with AWS Partners to design and scale artificial intelligence solutions for public sector use cases to meet compliance standards. With a background in Computer Science, his work covers broad range of ML use cases primarily focusing on LLM training/inferencing and computer vision. In his spare time, he loves playing tennis and swimming.
Joel Asante, an Austin-based Solutions Architect at Amazon Web Services (AWS), works with GovTech (Government Technology) customers. With a strong background in data science and application development, he brings deep technical expertise to creating secure and scalable cloud architectures for his customers. Joel is passionate about data analytics, machine learning, and robotics, leveraging his development experience to design innovative solutions that meet complex government requirements. He holds 13 AWS certifications and enjoys family time, fitness, and cheering for the Kansas City Chiefs and Los Angeles Lakers in his spare time.