Run existing Model Context Protocol (MCP) stdio-based servers in AWS Lambda functions
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"run-model-context-protocol-servers-with-aws-lambda": {
"args": [
"-y",
"my-mcp-server"
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
This project enables you to run Model Context Protocol stdio-based servers in AWS Lambda functions.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y 'my-mcp-server' 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 my-mcp-server 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
MCP Server for GCP environment for interacting with various Observability APIs.
Yunxiao MCP Server provides AI assistants with the ability to interact with the Yunxiao platform. It provides a set of tools that interact with Yunxiao's API, allowing AI assistants to manage Codeup repository, Project, Pipeline, Packages etc.
MCP server for Datto SaaS Protection — M365/GWS backups, restores, seats.
IAM Policy Autopilot is an open source static code analysis tool that helps you quickly create baseline AWS IAM policies that you can refine as your application evolves. This tool is available as a command-line utility and MCP server for use within AI coding assistants for quickly building IAM policies.
MCP Security Weekly
Get CVE alerts and security updates for Run Model Context Protocol Servers With Aws Lambda and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
This project enables you to run Model Context Protocol stdio-based servers in AWS Lambda functions.
Currently, most implementations of MCP servers and clients are entirely local on a single machine. A desktop application such as an IDE or Claude Desktop initiates MCP servers locally as child processes and communicates with each of those servers over a long-running stdio stream.
flowchart LR
subgraph "Your Laptop"
Host["Desktop Application<br>with MCP Clients"]
S1["MCP Server A<br>(child process)"]
S2["MCP Server B<br>(child process)"]
Host <-->|"MCP Protocol<br>(over stdio stream)"| S1
Host <-->|"MCP Protocol<br>(over stdio stream)"| S2
end
This library helps you to wrap existing stdio MCP servers into Lambda functions. You can invoke these function-based MCP servers from your application using the MCP protocol over short-lived HTTPS connections. Your application can then be a desktop-based app, a distributed system running in the cloud, or any other architecture.
flowchart LR
subgraph "Distributed System"
App["Your Application<br>with MCP Clients"]
S3["MCP Server A<br>(Lambda function)"]
S4["MCP Server B<br>(Lambda function)"]
App <-->|"MCP Protocol<br>(over HTTPS connection)"| S3
App <-->|"MCP Protocol<br>(over HTTPS connection)"| S4
end
Using this library, the Lambda function will manage the lifecycle of your stdio MCP server. Each Lambda function invocation will:
This library supports connecting to Lambda-based MCP servers in four ways:
Many stdio-based MCP servers's documentation encourages using tools that download and run the server on-demand.
For example, uvx my-mcp-server or npx my-mcp-server.
These tools are often not pre-packaged in the Lambda environment, and it can be inefficient to
re-download the server on every Lambda invocation.
Instead, the examples in this repository show how to package the MCP server along with
the Lambda function code, then start it with python or node (or npx --offline) directly.
You will need to determine the right parameters depending on your MCP server's package. This can often be a trial and error process locally, since MCP server packaging varies.
Basic example:
from mcp.client.stdio import StdioServerParameters
server_params = StdioServerParameters(
command=sys.executable,
args=[
"-m",
"my_mcp_server_python_module",
"--my-server-command-line-parameter",
"some_value",
],
)
Locally, you would run this module using:
python -m my_mcp_server_p
... [View full README on GitHub](https://github.com/awslabs/run-model-context-protocol-servers-with-aws-lambda#readme)