Get the FREE Ultimate OpenClaw Setup Guide →

sam less

MCP server from eleva/sam-serverless-mcp-server

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-sam-serverless-mcp-server node src/index.js

How to use

This MCP server is a minimal Model Context Protocol (MCP) server implemented in Node.js and deployed as an AWS Lambda function via the Serverless Application Model (SAM). It exposes an HTTP endpoint at /mcp where clients can send JSON-RPC requests to discover tools or invoke tool methods. The example tool included with this project is add, which takes two numbers a and b and returns their sum as a content payload. You can interact with the server locally using SAM and curl to simulate a client calling the MCP API, or deploy to AWS and call the API Gateway endpoint produced by the deployment. Tools are registered on the MCP server at startup and can be listed or invoked through the standard MCP tooling conventions.

How to install

Prerequisites:

  • Node.js v22+ (for development and building the Node-based MCP server)
  • Docker (for local SAM emulation if desired)
  • AWS CLI (for deployment)
  • SAM CLI (for building and deploying)

Installation steps:

  1. Clone or download the repository to your local machine.
  2. Install dependencies:
npm install
  1. Test the server locally with SAM:
sam build
sam local start-api

This will start the local API Gateway replacement and your MCP endpoint will be available at http://localhost:3000/mcp 4) Deploy to AWS:

sam build
sam deploy --guided

Follow the prompts to configure the stack name, region, and parameters. After a successful deploy, note the API endpoint URL printed by the deployment process and use it to call the MCP endpoint in the cloud.

Notes:

  • The code expects to be run in a Node.js environment; locally you can start the function via SAM and access /mcp as described.
  • If you modify templates or tools, re-run sam build and re-deploy as needed.

Additional notes

Tips and common considerations:

  • The MCP server is designed to be lightweight and relies on the @modelcontextprotocol/sdk for MCP behavior; ensure your AWS Lambda runtime supports the same Node version as your development environment.
  • When running locally, the endpoint is typically http://localhost:3000/mcp; if you switch to a different port in SAM, adjust accordingly.
  • If you need to switch deployment from REST API (Api) to HTTP API (HttpApi), update template.yml Events section as described in the README (HttpApi supports lower latency and different request/response shapes).
  • Environment variables can be added under the env field in mcp_config to customize server name, version, or to inject configuration for deployments.
  • For testing tools, you can use the included curl examples in the README to list tools and call the add tool.
  • Ensure Docker is available if you intend to run SAM locally with containers for a closer production-like environment.

Related MCP Servers

Sponsor this space

Reach thousands of developers