Lambda MCP Server

v1.0.0Cloud Servicesstable

Creates a simple MCP tool server with 'streaming' HTTP.

amazon-web-servicesawsaws-lambdalambdalambda-functions
Share:
232
Stars
0
Downloads
0
Weekly
0/5

What is Lambda MCP Server?

Lambda MCP Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to creates a simple mcp tool server with 'streaming' http.

Creates a simple MCP tool server with 'streaming' HTTP.

This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Creates a simple MCP tool server with 'streaming' HTTP.

Use Cases

Create MCP servers in AWS Lambda
Use streaming HTTP with Lambda
Build serverless MCP endpoints
mikegc-aws

Maintainer

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

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx lambda-mcp-server

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 Lambda MCP Server

The Lambda MCP Server is a framework and demo that shows how to build and deploy Model Context Protocol tool servers on AWS Lambda using streaming HTTP — enabling serverless, auto-scaling MCP endpoints without managing persistent infrastructure. The included awslabs.mcp_lambda_handler Python library handles request routing, session persistence via DynamoDB, and bearer-token authentication, so developers can focus on writing tool functions. Cloud architects and AI developers use it as a template for deploying custom MCP servers to AWS that scale to zero when idle and integrate with Amazon Bedrock.

Prerequisites

  • An AWS account with permissions to deploy Lambda, API Gateway, DynamoDB, and S3
  • AWS SAM CLI installed and configured with credentials
  • Amazon Bedrock access enabled in your AWS region, with the Amazon Nova Pro model enabled
  • Python 3.10+ and pip or uv for local development
  • An MCP-compatible AI client such as Claude Desktop or the Bedrock-hosted agent
1

Install the Lambda handler library

Install the awslabs.mcp_lambda_handler package, which provides the MCPLambdaHandler class and request routing logic.

pip install awslabs.mcp_lambda_handler
# Or with uv:
uv add awslabs.mcp_lambda_handler
2

Clone the demo repository

Clone the Lambda MCP Server repository to get the example SAM template, Lambda function code with sample tools, and the Bedrock agent client.

git clone https://github.com/mikegc-aws/Lambda-MCP-Server.git
cd Lambda-MCP-Server
3

Write or review your tool functions

Define MCP tools as Python functions decorated with @mcp_server.tool(). The demo includes three example tools: get_weather, count_s3_buckets, and get_time. Replace or extend these with your own business logic.

from awslabs.mcp_lambda_handler import MCPLambdaHandler

mcp_server = MCPLambdaHandler(name="mcp-lambda-server", version="1.0.0")

@mcp_server.tool()
def count_s3_buckets() -> str:
    import boto3
    return str(len(boto3.client('s3').list_buckets()['Buckets']))

def lambda_handler(event, context):
    return mcp_server.handle_request(event, context)
4

Deploy with AWS SAM

Build and deploy the SAM stack. When prompted, provide an McpAuthToken — this is the bearer token clients will use to authenticate to your API Gateway endpoint. Note the API Gateway URL from the stack outputs.

sam build && sam deploy --guided
5

Configure session persistence with DynamoDB

Session state is persisted to a DynamoDB table. The table name defaults to 'mcp_sessions' and is configured via the MCP_SESSION_TABLE environment variable on the Lambda function, which the SAM template sets automatically.

6

Connect your MCP client to the Lambda endpoint

Use the API Gateway URL and your McpAuthToken to connect an MCP client. For Claude Desktop, use mcp-remote to bridge HTTP to stdio.

npx mcp-remote@latest https://<your-api-id>.execute-api.<region>.amazonaws.com/Prod/mcp --header "Authorization: Bearer <McpAuthToken>"

Lambda MCP Server Examples

Client configuration

Connect Claude Desktop to your deployed Lambda MCP endpoint using mcp-remote as a local stdio bridge.

{
  "mcpServers": {
    "lambda-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote@latest",
        "https://<your-api-id>.execute-api.<region>.amazonaws.com/Prod/mcp",
        "--header",
        "Authorization: Bearer <McpAuthToken>"
      ]
    }
  }
}

Prompts to try

These prompts exercise the demo tools included in the Lambda MCP Server example.

- "How many S3 buckets do I have in my AWS account?"
- "What is the current UTC time?"
- "What is the weather in Seattle?" (returns simulated data)
- "Get the current time and tell me how long it has been since the last request."

Troubleshooting Lambda MCP Server

sam deploy fails with permission errors

Your AWS credentials must have permissions to create Lambda functions, API Gateway APIs, DynamoDB tables, and IAM roles. Use an IAM user or role with AdministratorAccess for initial deployment, then tighten permissions after.

API Gateway returns 401 Unauthorized

Ensure you are passing the Authorization header with the exact McpAuthToken value you set during 'sam deploy --guided'. Tokens are case-sensitive. Redeploy with 'sam deploy' if you need to change the token.

Lambda function cold starts cause MCP connection timeouts

For low-latency use, enable Lambda Provisioned Concurrency on the function in the SAM template. Alternatively, increase the MCP client connection timeout setting to accommodate cold start latency (typically 1-3 seconds).

Frequently Asked Questions about Lambda MCP Server

What is Lambda MCP Server?

Lambda MCP Server is a Model Context Protocol (MCP) server that creates a simple mcp tool server with 'streaming' http. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Lambda MCP Server?

Follow the installation instructions on the Lambda MCP Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Lambda MCP Server?

Lambda MCP Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Lambda MCP Server free to use?

Yes, Lambda MCP Server is open source and available under the MIT-0 license. You can use it freely in both personal and commercial projects.

Browse More Cloud Services MCP Servers

Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "lambda-mcp-server": { "command": "npx", "args": ["-y", "lambda-mcp-server"] } } }

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

Read the full setup guide →

Ready to use Lambda MCP Server?

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