Get the FREE Ultimate OpenClaw Setup Guide →

Remote

Create Remote MCP Server on Kubernetes (Amazon EKS)

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio saha-rajdeep-remote-mcp-server python server.py \
  --env PORT="8000 (default unless overridden by container/runtime)" \
  --env MCP_LOG_LEVEL="INFO (optional)"

How to use

This MCP server hosts a FastMCP-based calculator tool that exposes a single operation: add_numbers(a, b). The server is packaged in a container and is intended to run in Kubernetes (Amazon EKS) or locally via Docker. Clients connect over HTTP to the /mcp/ endpoint and interact with the MCP session using the standardized protocol: initialize a session, declare capabilities, list available tools, and then invoke add_numbers with two numeric inputs. The curl workflow in the documentation demonstrates how to initialize the session, announce readiness via notifications/initialized, list tools, and call add_numbers with arguments a and b. A Python test client is also provided to exercise the MCP server end-to-end. When you call add_numbers, the server returns a numeric result that is the sum of the two inputs.

How to install

Prerequisites:

  • Docker (for building and running container locally)
  • Python (optional if running outside container)
  • kubectl and AWS CLI (for deploying to Amazon EKS)

Local development and testing (Docker):

  1. Build the container image:
docker build -t mcp-calculator:latest .
  1. Run the container locally:
docker run -p 8000:8000 mcp-calculator:latest
  1. The server will be available at http://localhost:8000

If you prefer to run directly with Python (outside Docker):

  1. Install Python dependencies from requirements.txt:
pip install -r requirements.txt
  1. Start the server:
python server.py
  1. The server will typically listen on port 8000 by default, or as configured in your environment.

Deploying to Amazon EKS (Kubernetes):

  1. Ensure AWS CLI, kubectl, and Docker are installed and configured.
  2. Build and push your container image to your registry (Docker Hub or ECR).
  3. Update k8s-deployment.yaml to point to your image registry.
  4. Deploy:
kubectl apply -f k8s-deployment.yaml
  1. Check deployment status and fetch the LoadBalancer service IP:
kubectl rollout status deployment/mcp-calculator
kubectl get services mcp-calculator-service
  1. Access the MCP endpoint via the LoadBalancer URL at /mcp/.

Prerequisites for EKS deployment are described in the README (AWS CLI, kubectl, Docker).

Additional notes

Notes and tips:

  • The MCP protocol steps (especially notifications/initialized) are required after initialization.
  • Sessions have a time-to-live generally around 30-60 seconds in this FastMCP setup; complete the workflow quickly or implement a keep-alive pattern if supported by your client.
  • Use the provided test_mcp_client.py to validate your server locally before deploying to Kubernetes.
  • If you modify the server image, update the Kubernetes deployment manifest (k8s-deployment.yaml) to reference the new image tag.
  • The add_numbers tool expects inputs a and b as numbers; the response returns both a structured and plain text representation of the result.

Related MCP Servers

Sponsor this space

Reach thousands of developers