At this point, you may find many if not an overwhelming amount of options when considering to deploy MCP (Model Context Protocol) servers. You can choose the embedded route where you directly create these servers through the base framework (ie FastMCP for Pythonistas) or relegate the creation to higher order modules (ie FastAgent)
Well today, its not so much on the creation of these servers but rather the deployment. I will zoom out and instead look at the existing architectural options on the deployment of MCP server architectures on AWS.
1. AWS Solutions Library Version
- Page: https://aws.amazon.com/solutions/guidance/deploying-model-context-protocol-servers-on-aws/
- Github: https://github.com/aws-solutions-library-samples/guidance-for-deploying-model-context-protocol-servers-on-aws
This architecture shows how to securely deploy Model Context Protocol (MCP) servers on AWS using containers. It covers implementing OAuth 2.0 authentication, adding security layers like CDNs and firewalls, managing client sessions and tokens, setting up centralized logging, and ensuring high availability through container orchestration. Following this deployment helps organizations create a really well-thought out end-to-end archtecture.
Would recommend deploying this if you seek secure, scalable MCP server deployment with maximum system reliability but aren't constrained by cost factors. The caveat to this solution is to a non-enterprise account holder, this may seem overengineered, especially when the mcp-server is hosted on Fargate runtimes. The other solutions listed here use AWS Lambda to host their MCP servers.
2. Direct AWS Lambda Deployment using FastMCP
- Page: https://deepwiki.com/aws-samples/sample-serverless-mcp-servers/2.2-stateless-mcp-on-lambda-(python)
- Github: https://github.com/aws-samples/sample-serverless-mcp-servers/tree/7cf498235fab11b897c553c60000be2a310ca33e/stateless-mcp-on-lambda-python
This deployment method is a serverless FastMCP server using Python on AWS Lambda. It uses AWS API Gateway for handling requests and AWS SAM for easy deployment, offering a simple way to host MCP services without managing servers. This deployment method is arguably probably the most popular for deploying mcp servers directly for python developers. It leverages FastMCP base framework so all the FastMCP functionalities are available to you from the get-go.
The major caveat about using FastMCP on Lambda, you are likely to experience major cold start issues when starting your functions, approximately 3-5 seconds. Another caveat is that using python, you would have to deploy the solution with an additional LambdaAdapterLayer which is written in Rust
arn:aws:lambda:us-east-1:753240598075:layer:LambdaAdapterLayerX86:25
.
This may be a concern if you care about making your solution as lean as possible.
3. Lambda-MCP-Server
- Video: https://www.youtube.com/watch?v=Ejua5LQTqek&list=PLeAh2CQypN9V8E-pkG6ZAXj-w3dgy1qQn&index=2
- Github: https://github.com/mikegc-aws/Lambda-MCP-Server/tree/main?tab=readme-ov-file
This wonderful gem of a library was made by Mike Chambers, a Developer Advocate at AWS. And its so far the most recent and leanest example on MCP server side implementation I've seen so far. The library takes the entire MCP protocol logic and rewrote it for faster and more efficient usage in lambda.
One key boon on using this library is that the connection itself has been rewritten to be MCP-compliant while removing most of the latency issue that the previous lambda+FastMCP has. The con here is that the library is not maintained by the official FastMCP team, so you may not find long-term or most up-top-date updates on the MCP protocol using this library. Lastly, so far the library has been geared towards tool usage, instead of other things like resource, so keep that in mind.
Hope you've learnt something. Feel free to Connect with me on (linkedin)[https://www.linkedin.com/in/daniel-sim-xien-709445112/].
Top comments (0)