Allows deployment of the MCP server on Amazon EKS (Elastic Kubernetes Service), providing a containerized environment for running the calculator tool with LoadBalancer support for external access.
Enables containerization of the MCP server using Docker, allowing for consistent deployment and execution of the calculator service across different environments.
Provides deployment configuration for running the MCP calculator service on Kubernetes, including deployment specifications and LoadBalancer service setup for external access.
Uses Python for implementing the FastMCP server that provides the calculator functionality, with support for tool definitions and JSON-RPC communication.
Remote MCP Server on Kubernetes (Amazon EKS)
A containerized MCP (Model Context Protocol) server using FastMCP that provides a simple calculator tool for adding two numbers. This MCP server runs on Amazon EKS. The highlevel diagram of this project below:
Files
server.py
- FastMCP server with add_numbers toolrequirements.txt
- Python dependenciesDockerfile
- Container definitionk8s-deployment.yaml
- Kubernetes deployment and LoadBalancer servicetest_mcp_client.py
- Test Remote MCP Server
Building the Container
Running Locally
The server will be available at http://localhost:8000
Push to repo
You can push this image to either Dockerhub or an ECR repo
Deploying to Amazon EKS
Prerequisites
- AWS CLI configured with appropriate permissions
- kubectl installed
- Docker installed and running
EKS Cluster
You can use an existing EKS cluster or create a new one, it's upto you. Ensure that your terminal has access to run Kubectl on it
Deployment Steps
IMPORTANT: Change the container image to the repo URI in k8s-deployment.yaml file
- Deploy MCP Server container to EKS:
- Get the LoadBalancer external IP:
Testing the MCP Server
The server provides one tool:
add_numbers(a: float, b: float) -> float
- Adds two numbers together
Testing with curl
The MCP server is currently deployed and accessible at:
Complete curl Test Workflow
Step 1: Initialize MCP Session and Get Session ID
Step 2: Send Initialization Notification (Required by MCP Protocol)
Step 3: List Available Tools (Optional)
Expected Result:
Step 4: Call the add_numbers Tool
Expected Result:
Testing with Python client
Replace the URL in the test_mcp_client.py, and execute it. This will act as MCP client and test the MCP server
Important Notes
- Session Timeout: Sessions expire after ~30-60 seconds due to FastMCP framework limitations
- Rapid Execution: Execute all steps quickly or use the one-liner command
- MCP Protocol: The
notifications/initialized
step is required by the MCP protocol after initialization
Cleanup
To remove from Kubernetes:
This server cannot be installed
A containerized MCP (Model Context Protocol) server that provides a simple calculator tool for adding two numbers, deployable to Kubernetes/EKS environments.
Related MCP Servers
- AsecurityFlicenseAqualityA simple Model Context Protocol server that provides standardized tool functionality, currently implementing a basic calculator for adding two numbers together.Last updated -2738JavaScript
- AsecurityAlicenseAqualityA minimal Model Context Protocol server that provides a simple add(a, b) tool for computing the sum of two numbers.Last updated -15JavaScriptMIT License
- AsecurityFlicenseAqualityA numerical calculator based on Model Context Protocol (MCP) that provides simple arithmetic operations including addition, subtraction, multiplication, division, power, square root and integer factorial calculations.Last updated -7Python
- AsecurityFlicenseAqualityA simple TypeScript MCP server that provides two tools: one for greeting users with a customizable name and another for adding two numbers together.Last updated -213TypeScript