Serverless MCP Samples
Sample implementations of AI Agents and MCP Servers running on AWS Serverless compute
What is Serverless MCP Samples?
Serverless MCP Samples is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to sample implementations of ai agents and mcp servers running on aws serverless compute
Sample implementations of AI Agents and MCP Servers running on AWS Serverless compute
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Sample implementations of AI Agents and MCP Servers running
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx sample-serverless-mcp-serversConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Serverless MCP Samples
Sample Serverless MCP Servers is an AWS-maintained collection of eight reference implementations demonstrating how to build and deploy Model Context Protocol servers on AWS serverless and container infrastructure including Lambda, ECS, and API Gateway. The samples cover stateless and stateful server architectures using both Python and Node.js runtimes, with infrastructure-as-code provided in Terraform, AWS SAM, and CDK — giving developers a production-ready starting point for hosting MCP servers at scale without managing dedicated server infrastructure. Teams migrating from local MCP servers to cloud-hosted deployments use these samples as architectural blueprints.
Prerequisites
- AWS account with appropriate IAM permissions to deploy Lambda, ECS, API Gateway, and related resources
- AWS CLI installed and configured (aws configure) with your credentials
- Terraform, AWS SAM CLI, or AWS CDK installed depending on which sample you choose to deploy
- Node.js 18+ or Python 3.9+ depending on the sample runtime (Node.js for -nodejs samples, Python for -python samples)
- Git to clone the repository and access individual sample directories
Clone the repository
Clone the aws-samples repository to your local machine. Each sample lives in its own subdirectory with independent deployment instructions.
git clone https://github.com/aws-samples/sample-serverless-mcp-servers.git
cd sample-serverless-mcp-serversChoose a sample implementation
Review the eight available samples and select the one that matches your target architecture. For simple stateless scaling, choose stateless-mcp-on-lambda-python or stateless-mcp-on-lambda-nodejs. For session-persistent workloads choose stateful-mcp-on-ecs-python or stateful-mcp-on-ecs-nodejs. For AI agent patterns using the Strands SDK, choose strands-agent-on-lambda.
# Available samples:
# strands-agent-on-lambda - Strands SDK agent on Lambda
# strands-agent-on-lambda-python - Pure Python Strands agent (SAM)
# stateless-mcp-on-lambda-nodejs - Stateless MCP on Lambda (Terraform)
# stateless-mcp-on-lambda-python - Stateless MCP on Lambda (SAM)
# stateless-mcp-on-ecs-nodejs - Stateless MCP on ECS (Terraform)
# stateful-mcp-on-ecs-nodejs - Stateful MCP on ECS (Terraform)
# stateful-mcp-on-ecs-python - Stateful MCP on ECS (SAM)
# lambda-ops-mcp-server - Local MCP server for Lambda runtime opsNavigate to your chosen sample and review its README
Each sample directory contains its own deployment instructions. Read the sample-specific README before deploying, as requirements and deployment commands vary significantly between samples.
cd stateless-mcp-on-lambda-python
cat README.mdInstall dependencies for the chosen sample
For Python samples, install dependencies using pip. For Node.js samples, run npm install. SAM-based samples use 'sam build' which handles dependencies automatically during the build step.
# For Python SAM samples:
pip install -r requirements.txt
sam build
# For Node.js Terraform samples:
npm install
terraform initDeploy to AWS
Deploy using the infrastructure tool appropriate to your chosen sample. SAM samples use 'sam deploy --guided' for the first deployment. Terraform samples use 'terraform apply'. CDK samples use 'cdk deploy'.
# SAM deployment (Python samples):
sam deploy --guided
# Terraform deployment (Node.js samples):
terraform plan
terraform apply
# CDK deployment:
cdk bootstrap
cdk deployConfigure your MCP client to connect to the deployed endpoint
After deployment, AWS outputs the endpoint URL for your MCP server. Add this to your MCP client configuration as a remote server endpoint using Streamable HTTP transport.
{
"mcpServers": {
"serverless-mcp": {
"url": "https://your-api-gateway-url.execute-api.us-east-1.amazonaws.com/prod/mcp",
"transport": "http"
}
}
}Serverless MCP Samples Examples
Client configuration
Example MCP client configuration connecting to a deployed serverless MCP server via Streamable HTTP transport. Replace the URL with your actual API Gateway endpoint output from the deployment.
{
"mcpServers": {
"serverless-mcp": {
"url": "https://your-api-gateway-id.execute-api.us-east-1.amazonaws.com/prod/mcp",
"transport": "http"
}
}
}Prompts to try
Example prompts once your serverless MCP server is deployed and connected.
- "List all Lambda functions in my AWS account and show me their runtime versions"
- "Which Lambda functions are still using deprecated runtimes that need upgrading?"
- "Show me the tools available from my serverless MCP server"
- "Run the sample agent task to verify the Strands agent is deployed correctly"
- "What is the current status of my ECS service running the stateful MCP server?"Troubleshooting Serverless MCP Samples
SAM deploy fails with insufficient IAM permissions
Ensure your AWS CLI credentials have permissions to create Lambda functions, API Gateway, IAM roles, and CloudFormation stacks. For development, attach the AdministratorAccess policy temporarily. For production, use the least-privilege IAM policies documented in each sample's README.
Stateful MCP server loses session context between requests
Stateful ECS-based servers require sticky sessions (session affinity) on the load balancer so that follow-up requests from the same MCP client always route to the same ECS task. Verify the ALB target group has stickiness enabled with a duration matching your expected session length.
MCP client cannot connect to the deployed HTTP endpoint
Verify the API Gateway endpoint URL is correct and the deployment completed without errors. Check that your MCP client supports Streamable HTTP transport (not just stdio). Test the endpoint directly with curl to confirm it returns a valid MCP response: 'curl -X POST https://your-endpoint/mcp -H Content-Type:application/json -d {}'.
Frequently Asked Questions about Serverless MCP Samples
What is Serverless MCP Samples?
Serverless MCP Samples is a Model Context Protocol (MCP) server that sample implementations of ai agents and mcp servers running on aws serverless compute It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Serverless MCP Samples?
Follow the installation instructions on the Serverless MCP Samples GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Serverless MCP Samples?
Serverless MCP Samples works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Serverless MCP Samples free to use?
Yes, Serverless MCP Samples is open source and available under the MIT-0 license. You can use it freely in both personal and commercial projects.
Serverless MCP Samples Alternatives — Similar Developer Tools Servers
Looking for alternatives to Serverless MCP Samples? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Serverless MCP Samples in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Serverless MCP Samples?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.