The MCP Lambda Server for AWS is a Node.js package designed to provide MCP (Model Context Protocol) server infrastructure for AWS Lambda functions. It supports Server-Sent Events (SSE) through Lambda response streaming, making it ideal for real-time applications.
To install the package, run the following command:
npm install @markvp/mcp-lambda-layer
Import the package and create your Lambda function:
import { MCPHandlerFactory } from '@markvp/mcp-lambda-layer';
import { z } from 'zod';
const factory = new MCPHandlerFactory({
tools: {
summarize: {
params: {
text: z.string(),
},
handler: async ({ text }) => {
const summary = await yourSummarizeImplementation(text);
return {
content: [{ type: 'text', text: summary }],
};
},
},
},
prompts: {
generate: {
description: 'Generate content based on a prompt',
handler: async extra => {
const result = await yourGenerateImplementation(extra.prompt);
return {
content: [{ type: 'text', text: result }],
};
},
},
},
});
export const handler = factory.getHandler();
index.handler
This package includes:
Your Lambda function provides:
This project is licensed under the MIT License.
The MCP Lambda Server for AWS is a Lambda Layer that enables a Lambda function to operate as an MCP server. It is designed for developers looking to integrate MCP with AWS Lambda for real-time, scalable applications.