AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT-0 Self-run

Sample Serverless Mcp Servers

mcp-aws-samples-sample-serverless-mcp-servers · by aws-samples

Sample implementations of AI Agents and MCP Servers running on AWS Serverless compute

No reviews yet
0 installs
21 views
0.0% view→install

Install

$ agentstack add mcp-aws-samples-sample-serverless-mcp-servers

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-aws-samples-sample-serverless-mcp-servers)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
5mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Sample Serverless Mcp Servers? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Sample Serverless MCP Servers

This repo contains a collection of sample implementations of MCP Servers.

| Directory | Runtime | IaC | Description | |---|---|---|---| | [strands-agent-on-lambda](./strands-agent-on-lambda) | Python(Agent) Node.js(MCP) | Terraform, CDK | A sample implementation of AI Agent using Strands Agents SDK and connected MCP Server running on AWS Lambda, includes integration with Cognito for user authentication | | [strands-agent-on-lambda-python](./strands-agent-on-lambda-python) | Python | SAM | A sample implementation of AI Agent using Strands Agents SDK running on AWS Lambda | | [stateless-mcp-on-lambda-nodejs](./stateless-mcp-on-lambda-nodejs) | Node.js | Terraform | A sample implementation of a remote stateless MCP Server running natively on AWS Lambda and Amazon API Gateway | | [stateless-mcp-on-lambda-python](./stateless-mcp-on-lambda-python) | Python | SAM | A sample implementation of a remote stateless MCP Server running natively on AWS Lambda and Amazon API Gateway | | [stateless-mcp-on-ecs-nodejs](./stateless-mcp-on-ecs-nodejs) | Node.js | Terraform | A sample implementation of a remote stateless MCP Server running natively on Amazon ECS with Application Load Balancer | | [stateful-mcp-on-ecs-nodejs](./stateful-mcp-on-ecs-nodejs) | Node.js | Terraform | A sample implementation of a remote stateful MCP Server running natively on Amazon ECS with Application Load Balancer | | [stateful-mcp-on-ecs-python](./stateful-mcp-on-ecs-python) | Python | SAM | A sample implementation of a remote stateful MCP Server running natively on Amazon ECS with Application Load Balancer | | [lambda-ops-mcp-server](./lambda-ops-mcp-server) | Node.js | Terraform | A demo PoC of a local MCP Server that can be used for discovering and upgrading functions on deprecated runtimes |

Stateful VS Stateless MCP Servers

When using Streamable HTTP Transport with MCP Servers/Clients, it’s important to understand the difference and trade-offs between stateful and stateless MCP server implementations. Each model has implications for scalability, connection handling, and session management.

Key Aspects

The Streamable HTTP Transport specification outlines two important capabilities. First, a client may initiate a long-lived HTTP GET request to establish a persistent SSE (Server-Sent Events) connection, allowing the server to push data even when the client hasn’t sent a POST request. Second, if the connection is interrupted, the client should be able to resume communication by reconnecting through another GET request. Both features imply that the server must be able to maintain a persistent session context and support long-lived connections. Read more about Streamable HTTP Transport session management here.

Stateful model challenges

In a stateful MCP server, this means maintaining session state in memory and keeping SSE connections alive over time. However, as of early May 2025, none of the official MCP SDKs support external session persistence (e.g. in Redis or DynamoDB). This limitation makes it difficult to scale stateful servers horizontally. For example, a client might establish a session with one server instance, but if subsequent requests are routed to a different instance, the session context will be lost and the connection will fail.

That said, it is still possible to scale stateful MCP servers if you're willing to configure session affinity, also known as sticky sessions, at the load balancer level. For example, cookie-based sticky sessions can ensure that a client is routed to the same server instance for the duration of a session. However, the TypeScript MCP Client SDK currently relies on the fetch API, which doesn’t natively support cookies. To work around this limitation, you'll need to implement manual cookie handling, as shown in the stateful-mcp-on-ecs example.

Stateless to the rescue

The MCP specification also allows for a stateless server mode. In this mode, the server doesn’t maintain session context between requests, and clients are not expected to resume dropped connections. Stateless mode enables seamless horizontal scaling and works well in environments where elasticity and load distribution are critical. This model is demonstrated in the stateless-mcp-on-lambda, stateless-mcp-on-ecs, and stateless-mcp-on-lambda-python samples included in this repository.

Refer to each folder separately for further instructions and deployment steps.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.