Get the FREE Ultimate OpenClaw Setup Guide →

serverless

A super simple Model Context Protocol (MCP) server deployed on AWS Lambda and exposed via Amazon API Gateway, deployed with Serverless Framework.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio eleva-serverless-mcp-server node src/index.js \
  --env STAGE="dev" \
  --env AWS_REGION="us-east-1" \
  --env LAMBDA_HANDLER="src/index.handler"

How to use

This MCP server is designed to run as a Lambda-backed service exposed via API Gateway under the /mcp path. It uses the Model Context Protocol SDK to provide a minimal MCP server with a sample tool (add) that demonstrates how tools are registered and invoked via JSON-RPC. You can invoke the server locally using Serverless Offline or deploy it to AWS Lambda behind API Gateway. The server exposes a single HTTP POST endpoint that accepts MCP requests and returns MCP responses, including tool discovery (tools/list) and tool execution (tools/call) interactions. The included add tool demonstrates JSON-RPC style parameter passing and the content payload format that MCP tools return (e.g., content with type and text).

How to install

Prerequisites:

  • Node.js v18+ (the project lists Node.js v22+ as a prerequisite, ensure compatibility with your environment)
  • npm (comes with Node.js)
  • Serverless Framework (and Serverless Offline for local development)

Installation steps:

  1. Clone or download the repository and open a terminal in the project root.
  2. Install dependencies: npm install
  3. (Optional) Install Serverless globally if not already installed: npm install -g serverless or the project’s preferred variant (as noted in the README, some users may use osls).
  4. For local development with offline support, ensure serverless-offline is configured in serverless.yml (as in the README). Then start offline: npm run sls offline or sls offline

Local development note:

Deployment: 5) Deploy to AWS: sls deploy

  1. After deployment, obtain the endpoint URL from the Serverless output and send MCP requests to the /mcp path via POST.

Additional notes

Tips and notes:

  • The server is a minimal MCP server built with @modelcontextprotocol/sdk and Middy middleware to handle MCP requests.
  • The included example tool is add, which accepts two numbers a and b and returns their sum as a text payload in the MCP content structure.
  • If you enable API Gateway v2 (HTTP API), you can adjust serverless.yml to use httpApi instead of http for REST vs HTTP API semantics. Remember to update client requests accordingly (base URL path may differ and the /dev/ stage is not used with HTTP API).
  • When testing locally, ensure that port 3000 is available and not blocked by other services.
  • Environment variables can be used to configure deployment specifics (e.g., stage, region).

Related MCP Servers

Sponsor this space

Reach thousands of developers