Middy middleware for hosting MCP servers on AWS Lambda

Middy middleware for hosting MCP servers on AWS Lambda

sam-serverless-mcp-server•byfredericbarthelet

A Middy middleware that handles Model Context Protocol server requests and responses within AWS Lambda functions, supporting API Gateway and ALB proxy integrations.

License: MIT License•Runtime: Awaiting documentation review•Category: cloud devops

WHAT IT DOES

  • •Wires a Model Context Protocol server into a Middy-based Lambda handler through the mcpMiddleware.
  • •Handles MCP requests sent to AWS Lambda via API Gateway proxy integration or an ALB.
  • •Can throw HTTP exceptions, so it can be paired with the Middy HTTP error handler.

BEST FOR

  • •Developers hosting an MCP server as an AWS Lambda behind API Gateway.
  • •Teams already using the Middy middleware framework who want to expose an MCP server from Lambda.

ABOUT SAM-SERVERLESS-MCP-SERVER

Middy middleware for hosting MCP servers on AWS Lambda is cataloged as an MCP server attributed to fredericbarthelet. A Middy middleware that handles Model Context Protocol server requests and responses within AWS Lambda functions, supporting API Gateway and ALB proxy integrations. It is categorized under cloud devops. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Middy middleware for hosting MCP servers on AWS Lambda are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What client protocol versions are supported when hosting an MCP server this way?

It is only compatible with MCP clients using at least protocol version 2025-03-26.

What Node.js and Middy versions are required?

Node.js 18.0.0 or later and Middy 6.0.0 or later.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 4371528d76d5 · 采集于 2026-11-13 12:07:59 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Middy MCP

A Middy middleware for Model Context Protocol (MCP) server integration with AWS Lambda functions.

Description

Middy MCP is a middleware that enables seamless integration between AWS Lambda functions and Model Context Protocol servers. It provides a convenient way to handle MCP requests and responses within your Lambda functions using the Middy middleware framework. It supports requests sent to AWS Lambda from API Gateway (both REST API / v1 and HTTP API / v2) using the Proxy integration, as well as requests sent form an ALB.

Disclaimer: hosting your MCP server this way is only compatible with MCP clients using at least protocol version 2025-03-26.

Install

pnpm install middy-mcp

Requirements

  • Node.js >= 18.0.0
  • Middy >= 6.0.0

Usage

This middleware can throw HTTP exceptions, so it can be convenient to use it in combination with the @middy/http-error-handler.

Hereafter is an exemple of a minimal Lambda function handler file. Deploy this lambda as a proxy integration on a POST route of your API Gateway and you're good to go.

import middy from "@middy/core";
import httpErrorHandler from "@middy/http-error-handler";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

import mcpMiddleware from "middy-mcp";

// Create an MCP server
const server = new McpServer({
  name: "Lambda hosted MCP Server",
  version: "1.0.0",
});

// Add an addition tool
server.tool("add", { a: z.number(), b: z.number() }, async ({ a, b }) => ({
  content: [{ type: "text", text: String(a + b) }],
}));

export const handler = middy()
  .use(mcpMiddleware({ server }))
  .use(httpErrorHandler());

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to open an issue or to submit a pull request 🚀!

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Middy middleware for hosting MCP servers on AWS Lambda from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/sam-serverless-mcp-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related cloud devops MCP Servers

Alternative and complementary servers in the same category

View all in cloud devops →
Huawei MCP Server
mcp-server-huaweiclouddeveloper•huaweiclouddeveloper

A Model Context Protocol server built on Huawei Cloud services that enables AI assistants to operate Huawei Cloud resources within conversational workflows, supporting ECS, OBS, GaussDB, and other cloud products.

Repository stats unavailable
Cloud & DevOps
Coolify MCP Server
coolify-mcp-server•wrediam

An MCP server that exposes the Coolify v4.3.1 REST API so AI clients can manage applications, databases, services, servers, deployments, and more.

Repository stats unavailable
Cloud & DevOps

A deprecated Model Context Protocol server for interacting with Kong Konnect APIs, enabling AI assistants to query and analyze Kong Gateway configurations, traffic, and analytics.

Repository stats unavailable
Cloud & DevOps