EKS Model Context Protocol (MCP) Server

by mahmoudsalah84

333 downloads Not rated yet MIT
GitHub

About

# EKS Model Context Protocol (MCP) Server A lightweight, efficient server that implements the Model Context Protocol for EKS operations. This server provides a standardized interface for GenAI agents to interact with EKS clusters. ## Features - Fast response times with proper timeout handling - Comprehensive EKS…

Details

License
MIT

Explore

- Fast response times with proper timeout handling
- Comprehensive EKS operations support
- Kubernetes resource management (pods, services, deployments, etc.)
- Multiple authentication methods for EKS clusters
- Robust error handling and logging
- Docker containerization for easy deployment
- ECS deployment support

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name EKS Model Context Protocol (MCP) Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Docker
- AWS credentials (for production use)
- Python 3.8+ (for local development)

The server supports multiple authentication methods for EKS clusters:

1. AWS SDK Authentication: Uses the AWS SDK to authenticate with EKS and get cluster information
2. Kubectl with Generated Kubeconfig: Creates a temporary kubeconfig file and uses kubectl
3. Direct Kubernetes API Calls: Makes direct API calls to the Kubernetes API server

The current implementation uses the Kubectl method with proper authentication, which provides the most reliable results.


pip install -r requirements.txt

bash


See the ECS Deployment README for detailed instructions.

bash

cd ecs-deployment
./deploy.sh

./update-service.sh


The project includes a client implementation that uses Amazon Bedrock for conversational interaction with the MCP server. See the Client README for details.

bash

For the server to authenticate with EKS clusters, the ECS task role needs to be added to the EKS cluster's aws-auth ConfigMap. See the ECS Deployment README for detailed instructions.

The server is currently deployed to ECS and accessible at:
- Endpoint: http://3.90.45.69:8000
- Health check: http://3.90.45.69:8000/health
- Operations discovery: http://3.90.45.69:8000/mcp/v1/operations

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "eks model context protocol (mcp) server": {
            "eks-mcp-server-new": {
                "command": "python",
                "args": [
                    "main.py"
                ]
            }
        }
    }
}

McpServers

{
    "eks-mcp-server-new": {
        "command": "python",
        "args": [
            "main.py"
        ]
    }
}

A lightweight, efficient server that implements the Model Context Protocol for EKS operations. This server provides a standardized interface for GenAI agents to interact with EKS clusters.

Features

- Fast response times with proper timeout handling
- Comprehensive EKS operations support
- Kubernetes resource management (pods, services, deployments, etc.)
- Multiple authentication methods for EKS clusters
- Robust error handling and logging
- Docker containerization for easy deployment
- ECS deployment support

Project Structure

- main.py: Main server implementation with FastAPI
- eks_operations.py: EKS API operations implementation
- k8s_operations.py: Kubernetes API operations implementation
- k8s_operations_sdk_v4.py: SDK-based Kubernetes operations implementation
- k8s_operations_kubectl.py: Kubectl-based Kubernetes operations with proper authentication
- k8s_auth_config.py: Authentication configuration for Kubernetes
- direct_k8s_client.py: Direct Kubernetes API client implementation
- test_*.py: Various test scripts for different implementations
- Dockerfile and Dockerfile.amd64: Docker configuration files
- docker-compose.yml: Docker Compose configuration
- requirements.txt: Python dependencies
- client/: Client implementation directory (Client README)
- ecs-deployment/: ECS deployment scripts and configuration (ECS Deployment README)

API Endpoints

- GET /health - Health check endpoint
- GET /mcp/v1/operations - List available operations
- POST /mcp/v1/query - Execute MCP operations

Supported Operations

EKS Cluster Operations

- list_clusters - List EKS clusters in a region - describe_cluster - Get detailed information about a cluster - list_nodegroups - List nodegroups for a cluster - describe_nodegroup - Get detailed information about a nodegroup

Kubernetes Operations

- list_namespaces - List Kubernetes namespaces - list_pods - List pods in a namespace - describe_pod - Get detailed information about a pod - get_deployments - List deployments in a namespace - describe_deployment - Get detailed information about a deployment - get_services - List services in a namespace - describe_service - Get detailed information about a service - get_pod_logs - Get logs from a pod

Authentication Methods

The server supports multiple authentication methods for EKS clusters:

1. AWS SDK Authentication: Uses the AWS SDK to authenticate with EKS and get cluster information
2. Kubectl with Generated Kubeconfig: Creates a temporary kubeconfig file and uses kubectl
3. Direct Kubernetes API Calls: Makes direct API calls to the Kubernetes API server

The current implementation uses the Kubectl method with proper authentication, which provides the most reliable results.

Getting Started

Prerequisites

- Docker
- AWS credentials (for production use)
- Python 3.8+ (for local development)

Running Locally

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.