Serverless MCP Samples

v1.0.0Developer Toolsstable

Sample implementations of AI Agents and MCP Servers running on AWS Serverless compute

sample-serverless-mcp-serversmcpai-integration
Share:
237
Stars
0
Downloads
0
Weekly
0/5

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

Explore sample implementations of MCP servers on AWS.
Learn AI Agent patterns using serverless compute.
Study production-ready MCP server examples.
aws-samples

Maintainer

LicenseMIT-0
Languagepython
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx sample-serverless-mcp-servers

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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-servers
2

Choose 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 ops
3

Navigate 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.md
4

Install 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 init
5

Deploy 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 deploy
6

Configure 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.

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.

Quick Config Preview

{ "mcpServers": { "sample-serverless-mcp-servers": { "command": "npx", "args": ["-y", "sample-serverless-mcp-servers"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides