serverless s-cdk
Sample implementations of MCP Servers running on AWS Serverless compute Resources
claude mcp add --transport stdio huanshenyi-serverless-mcp-servers-cdk aws cloudformation deploy --stack-name ServerlessMcpServersCdkStack --region us-east-1 \ --env AWS_REGION="us-east-1" \ --env AWS_PROFILE="your-aws-profile"
How to use
This MCP server is deployed as a serverless stack on AWS using CDK, running MCP logic inside Lambda and exposing an API through API Gateway. It provides two implementations: a Hono-based TypeScript MCP server (recommended) and an optional Express.js MCP server. The MCP client and testing utilities live under the src folder, allowing you to exercise MCP tools and resources against the deployed endpoint or a local mock. After deployment, you can test the remote MCP endpoint via the included client scripts, or configure Claude & Cursor to point at either localhost or the remote API Gateway URL. The Bearer token authentication option can be enabled to protect the MCP endpoints by setting MCP_AUTH_TOKEN in environment variables and passing the token in requests via the client or CLI.
How to install
Prerequisites:
- AWS CLI configured with appropriate permissions
- Node.js 22.x and npm
- AWS CDK installed and bootstrapped for your account
Installation steps:
-
Install the main project dependencies npm install
-
Install MCP client and server dependencies
- MCP client (cd src/js/mcpclient && npm install)
- Hono TypeScript MCP server (recommended) (cd src/ts/mcpserver && npm install)
- Express.js MCP server (optional) (cd src/js/mcpserver && npm install)
-
Bootstrap CDK (if not already bootstrapped) cdk bootstrap aws://<account-id>/us-east-1
-
Build and deploy the Hono-based MCP server (recommended) (cd src/ts/mcpserver && npm run build) npm run build cdk deploy --region us-east-1
-
Verify deployment and test locally or remotely using the MCP client and sample configuration provided in the repository.
Additional notes
Notes and tips:
- The CDK stack deploys a Lambda-backed MCP server behind API Gateway. The primary endpoint is us-east-1 and may take about a minute to become available after deployment.
- Hono is the recommended MCP server implementation; if you switch to the Express.js version, adjust the CDK stack to package the Express server code instead.
- Bearer token authentication can be enabled by setting MCP_AUTH_TOKEN in the environment (local dev, or Lambda environment variables in the CDK stack). Ensure your clients supply the Authorization header with a valid token.
- For local testing of the client and server, you can run the Hono TypeScript server locally (npm run dev in the ts/mcpserver directory) or run the Express server locally (node src/js/mcpserver/index.js).
- If you plan to switch between Hono and Express implementations, follow the documentation in the README to modify the CDK stack code to point to the correct asset (dist for Hono, or the Express build directory).
- API Gateway may take a short time to become available after deployment; if requests fail, retry after a minute.
Related MCP Servers
aws
Talk with your AWS using Claude. Model Context Protocol (MCP) server for AWS. Better Amazon Q alternative.
Security-Detections
MCP to help Defenders Detection Engineer Harder and Smarter
Lambda
Creates a simple MCP tool server with "streaming" HTTP.
furi
CLI & API for MCP management
aws
An MCP(Model Context Protocol) Server for AWS services
bc-webclient
MCP server for Microsoft Dynamics 365 Business Central via reverse-engineered WebUI protocol. Enables AI assistants like Claude to interact with BC through the native WebSocket interface.