MCP Lambda SAM logo

MCP Lambda SAM

by markvp

This project provides a serverless implementation of the Model Context Protocol using AWS Lambda and SAM. It offers interfaces for system configuration and client usage, enabling dynamic invocation of registered Lambda tools.

View on GitHub

Last updated: N/A

What is MCP Lambda SAM?

MCP Lambda SAM is a serverless implementation of the Model Context Protocol (MCP) built on AWS Lambda and SAM. It provides a framework for managing and invoking Lambda-based tools through a defined protocol, enabling dynamic interaction between clients and serverless functions.

How to use MCP Lambda SAM?

Administrators can deploy the application using the AWS SAM CLI or the AWS Serverless Application Repository (SAR). They can then register MCP tools, resources, and prompts using the Registration API. Clients can establish SSE connections and send commands to invoke the registered Lambda tools. IAM permissions are required for both administrators and clients to access the relevant Function URLs.

Key features of MCP Lambda SAM

  • Serverless implementation of Model Context Protocol

  • Administrative interface for tool registration and management

  • Client interface for establishing SSE connections and sending commands

  • Dynamic invocation of registered Lambda tools

  • IAM permission management for secure access

  • Support for streaming responses via SSE

Use cases of MCP Lambda SAM

  • Building serverless applications that require dynamic invocation of functions

  • Creating conversational AI interfaces

  • Developing event-driven architectures

  • Implementing microservices architectures

FAQ from MCP Lambda SAM

What is the Model Context Protocol (MCP)?

MCP is a protocol for managing and invoking Lambda-based tools.

What are the prerequisites for using MCP Lambda SAM?

You need an AWS account, AWS CLI, AWS SAM CLI, Node.js 20.x or later, and permissions to create Lambda functions, DynamoDB tables, IAM roles, and SQS queues.

How do I deploy MCP Lambda SAM?

You can deploy it using the AWS Serverless Application Repository (SAR), the npx @markvp/mcp-lambda-sam deploy command, programmatically with install, or through local development and deployment.

How do I register a new tool?

Use the Registration API's /register endpoint with a POST request, providing the tool's type, name, description, Lambda ARN, and parameters.

What IAM permissions are required for clients?

Clients need IAM permission to invoke the mcp function URL, specifically lambda:InvokeFunctionUrl with lambda:FunctionUrlAuthType set to AWS_IAM.