MCP.so
登录

Run Model Context Protocol (MCP) servers with AWS Lambda

@awslabs

关于 Run Model Context Protocol (MCP) servers with AWS Lambda

Run existing Model Context Protocol (MCP) stdio-based servers in AWS Lambda functions

基本信息

分类

云与基础设施

许可证

Apache-2.0

运行时

python

传输方式

stdio

发布者

awslabs

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "run-model-context-protocol-servers-with-aws-lambda": {
      "command": "python",
      "args": [
        "-m",
        "my_mcp_server_python_module",
        "--my-server-command-line-parameter",
        "some_value"
      ]
    }
  }
}

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is Run Model Context Protocol (MCP) servers with AWS Lambda?

It enables you to run MCP stdio-based servers in AWS Lambda functions, wrapping existing MCP servers so that clients communicate over short-lived HTTPS connections instead of long-running local stdio streams. This library targets developers who want to deploy MCP servers in a distributed cloud architecture while still using standard MCP tooling.

How to use Run Model Context Protocol (MCP) servers with AWS Lambda?

Install the package from PyPI (run-mcp-servers-with-aws-lambda) or NPM (@aws/run-mcp-servers-with-aws-lambda). Determine your MCP server’s command and arguments (using StdioServerParameters in Python or serverParams in TypeScript), then package the server with the Lambda function code. Use the provided handler classes (e.g., APIGatewayProxyEventHandler) to process incoming MCP requests. The README includes examples for both Python and TypeScript, as well as guidance on passing secrets and AWS credentials to the child process.

Key features of Run Model Context Protocol (MCP) servers with AWS Lambda?

  • Wraps stdio MCP servers into AWS Lambda functions.
  • Communicates over short‑lived HTTPS connections.
  • Supports Streamable HTTP transport via Amazon API Gateway.
  • Custom Streamable HTTP transport with SigV4 for Lambda function URLs.
  • Custom Lambda invocation transport using the Invoke API.
  • Manages full MCP server lifecycle per invocation (start, initialize, forward, respond, shutdown).

Use cases of Run Model Context Protocol (MCP) servers with AWS Lambda?

  • Deploy MCP servers in a distributed cloud system instead of a local machine.
  • Allow desktop applications (e.g., Claude Desktop, Cursor) to connect to cloud‑hosted MCP servers.
  • Enable multiple clients to share a single MCP server with OAuth‑based access control.
  • Run MCP servers in a serverless architecture for scalability and pay‑per‑use billing.
  • Integrate MCP with AWS‑native workflows (e.g., Bedrock AgentCore Gateway).

FAQ from Run Model Context Protocol (MCP) servers with AWS Lambda?

How does the Lambda function manage the MCP server lifecycle?

Each invocation starts the MCP server as a child process, initializes it, forwards the incoming request, returns the server’s response, and then shuts down the child process.

What authentication methods are available?

The library supports OAuth via API Gateway (e.g., Amazon Cognito), SigV4 authentication with Lambda function URLs, and IAM authentication when using the Lambda Invoke API.

How do I pass credentials or secrets to the wrapped MCP server?

You can configure secrets as encrypted Lambda environment variables or retrieve them from AWS Secrets Manager in the function code. The README provides code examples for both Python and TypeScript. Note that any user with invoke access can also use those secrets.

Which MCP transports are supported?

Four transports are supported: MCP Streamable HTTP via API Gateway, MCP Streamable HTTP via Amazon Bedrock AgentCore Gateway, a custom Streamable HTTP with SigV4 for Lambda function URLs, and a custom Lambda invocation transport using

评论

云与基础设施 分类下的更多 MCP 服务器