How to run MCP server on Kubernetes remotely

View profile for Rajdeep Saha

Bestselling Author & Educator | Former Principal Solutions Architect @AWS | YouTuber (100K+) | Public Speaker | Tech Advisor

You can code and run your MCP server remotely on Kubernetes. Here's how: 1. Write code which conforms to the MCP standards. What does this mean? it means, it should work with JSON RPC 2.0 and can process standard MCP methods such as tools/list should send the name and description of the tools, tools/call should be able to invoke the tools etc. These standards are defined by Anthropic 2. You can either code the methods for MCP yourself, which can be tedious. Or use MCP implementation with library like FastMCP 3. Run Dockerfile to create a container and save it in ECR 4. Deploy to the Kubernetes cluster such as in Amazon EKS, and expose it using a ALB via service or ingress. ALB and container support streamable HTTP out of the box, and works nicely 5. Invoke your MCP Server using the ALB Url. For Streamable HTTP, you need to initialize a session, and then use the sessionID for subsequent calls to do tool discovery, and tool calls Check out detailed step by step demo, along with related codes, and pros-cons of local vs remote MCP server: https://lnkd.in/eXKENy6R --- Get byte sized system design, behavioral, Gen AI, and other interview and career switch tips in weekly newsletter : https://lnkd.in/eG7XdHmN #genai #ai #systemdesign

  • diagram
Patryk Petryszen

☁️Cloud/Platform Engineer at Ocado Technology | AWS, GitLab, Terraform | DevOps & AI Automation♾️

3mo

Rajdeep Saha, implementing server design with Kubernetes amplifies operational efficiency significantly. Great insights shared.

Sushant Choudhary

Data and AI/ML Platform at Rakuten Rewards

3mo

Thanks Rajdeep, do you think deploying MCP servers and gateway via Bedrock Agentcore would be another recommended route?

Like
Reply
Lefteris Karageorgiou

I help you become Top 1% Cloud Expert | Senior Solutions Architect @AWS | Creator of The Cloud Engineers newsletter | Best-selling author | International speaker | Mentor

3mo

That's super insightful Rajdeep! We have built a workshop showcasing this exact flow with Java and Spring AI: https://catalog.workshops.aws/java-spring-ai-agents/en-US/deploy-to-aws/deploy-to-eks

Divine Odazie

Follow For All Things DevOps & Cloud Native - CEO @ EverythingDevOps - CNCF Ambassador - DevRel - International Speaker - Certified K8s Engineer - CKA, CKAD, KC{NA,SA}

3mo

Great breakdown, Rajdeep Saha Thank you for sharing 😍

Sudesh Gangan

Architected and Delivered Projects for Fortune 500 Customers - Nike, UBS, Edward Jones | 2X AWS Certified | Java, Microservices, Cloud

3mo

This is a excellent guide for MCP server on Kubernetes coding to MCP standards, containerizing, and leveraging EKS with ALB makes remote management seamless. Thanks for sharing the demo and resources; these will be super helpful for anyone looking to set up scalable, standards-compliant MCP services!

Like
Reply
HaHing Sun

AWS Certified GenAI Network Security | AWS User Group|Community Builder | Fortinet Cisco

2mo

很喜欢这个,Rajdeep

Like
Reply
Narinder Aggarwal

AWS | System Architecture & Design | Gen AI

3mo

Like your expertise in Kubernetes and solutions built on top of it !

Like
Reply
See more comments

To view or add a comment, sign in

Explore content categories