Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"lambda-mcp-server": {
"args": [
"awslabs.mcp_lambda_handler"
],
"command": "uvx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
⚠️ IMPORTANT: The Lambda MCP Server module code IS maintained, just not in this repository. It is now hosted and maintained at awslabs/mcp-lambda-handler. This repository remains as sample code of how to use the module. > To use the Lambda MCP Server, install the package directly from PyPI: > pip install awslabs.mcp_lambda_handler > uv add awslabs.mcp_lambda_handler
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
uvx 'awslabs.mcp_lambda_handler' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked awslabs.mcp_lambda_handler against OSV.dev.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in cloud / developer-tools
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
Manage Supabase projects — databases, auth, storage, and edge functions
MCP server for using the GitLab API
MCP Security Weekly
Get CVE alerts and security updates for Lambda MCP Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
⚠️ IMPORTANT: The Lambda MCP Server module code IS maintained, just not in this repository. It is now hosted and maintained at awslabs/mcp-lambda-handler. This repository remains as sample code of how to use the module.
To use the Lambda MCP Server, install the package directly from PyPI:
pip install awslabs.mcp_lambda_handler # or, if using uv: uv add awslabs.mcp_lambda_handler
This server requires a client that supports Streamable HTTP (not SSE). There are a few MCP clients that currently support Streamable HTTP including the MCP Inspector. There is also as a Streamable HTTP client included in this repo, built Strands Agents.
This project demonstrates a powerful and developer-friendly way to create serverless MCP (Model Context Protocol) tools using AWS Lambda. It showcases how to build a stateless, serverless MCP server with minimal boilerplate and an excellent developer experience.
In an episode of the_context, Tiffany Souterre and Mike discussed streamable HTTP for MCP as well as running (an older version of) this project:
Here is the minimal code to get an MCP server running in an AWS Lambda function:
from awslabs.mcp_lambda_handler import MCPLambdaHandler
mcp_server = MCPLambdaHandler(name="mcp-lambda-server", version="1.0.0")
@mcp_server.tool()
def get_time() -> str:
from datetime import datetime, UTC
return datetime.now(UTC).isoformat()
def lambda_handler(event, context):
return mcp_server.handle_request(event, context)
The Lambda MCP Server includes built-in session state management that persists across tool invocations within the same conversation. This is particularly useful for tools that need to maintain context or share data between calls.
Session data is stored in a DynamoDB table against a sessionId key. This is all managed for you.
Here's an example of how to use session state:
from lambda_mcp.lambda_mcp import LambdaMCPServer
session_table = os.environ.get('MCP_SESSION_TABLE', 'mcp_sessions')
mcp_server = LambdaMCPServer(name="mcp-lambda-server", version="1.0.0", session_store=session_table)
@mcp_server.tool()
def increment_counter() -> int:
"""Increment a session-based counter."""
# Get the current counter value from session state, default to 0 if not set
counter = mcp_server.session.get('counter', 0)
# Increment the counter
counter += 1
# Store the new value in session state
mcp_server.session['counter'] = counter
return counter
@mcp_server.tool()
def get_counter() -> int:
"""Get the current counter value."""
return mcp_server.session.get('counter', 0)
The session state is automatically managed per conversation and persists across multiple tool invocations. This allows you to maintain stateful information without needing additional external storage, while still keeping your Lambda function stateless.
The sample server stack uses Bearer token authentication via an Authorization header, which is compliant with the MCP standard. This provides a basic level of security for your MCP server endpoints. Here's what you need to know: