Run MCP Servers with AWS Lambda
raw JSON → 0.5.17 verified Fri May 01 auth: no python
Run Model Context Protocol (MCP) servers using AWS Lambda. Current version: 0.5.17. Active development, frequent releases.
pip install run-mcp-servers-with-aws-lambda Common errors
error ModuleNotFoundError: No module named 'run_mcp_servers_with_aws_lambda' ↓
cause Incorrect import alias; package installed but import uses hyphens instead of underscores.
fix
Install: pip install run-mcp-servers-with-aws-lambda. Import: from run_mcp_servers_with_aws_lambda import MPCServer
error RuntimeError: Requires Python >=3.11 ↓
cause Running on Python version older than 3.11.
fix
Upgrade Python to 3.11+ or use a compatible Lambda runtime.
Warnings
breaking Python >=3.11 required. Older versions will fail to install. ↓
fix Ensure runtime uses Python 3.11 or later.
gotcha Package name uses hyphens, but import uses underscores. Common import error. ↓
fix Use `from run_mcp_servers_with_aws_lambda import ...` (underscores).
deprecated Lambda execution environment must have appropriate AWS credentials and permissions (e.g., lambda:InvokeFunction). Not handled by library. ↓
fix Configure IAM roles and environment variables outside the library.
Imports
- MPCServer wrong
from run-mcp-servers-with-aws-lambda import MPCServercorrectfrom run_mcp_servers_with_aws_lambda import MPCServer
Quickstart
import os
from run_mcp_servers_with_aws_lambda import MPCServer
app = MPCServer(
function_name="my-mcp-server",
region=os.environ.get("AWS_REGION", "us-east-1"),
)
def handler(event, context):
return app.handle(event, context)