AWS EKS MCP Server

AWS EKS MCP Server

Enables creating and managing AWS EKS clusters via Terraform, including VPC, node groups, add-ons, and kubectl configuration.

Category
访问服务器

README

AWS EKS MCP Server

Comprehensive MCP server for creating and managing AWS EKS (Elastic Kubernetes Service) clusters using Terraform.

Features

Terraform Generation & Execution

  • generate_eks_terraform - Generate complete Terraform configs (VPC, EKS, node groups, IRSA)
  • eks_terraform_init - Initialize Terraform
  • eks_terraform_plan - Preview infrastructure changes
  • eks_terraform_apply - Create/update EKS cluster
  • eks_terraform_destroy - Destroy cluster and all resources

Kubectl Configuration

  • configure_kubectl - Automatically configure kubectl to access the cluster

Add-on Management

  • install_addon - Install common EKS add-ons:
    • AWS Load Balancer Controller
    • Metrics Server
    • Cluster Autoscaler
    • External DNS
    • Cert Manager

Cluster Management

  • upgrade_eks_cluster - Upgrade Kubernetes version
  • list_eks_clusters - List all EKS clusters
  • describe_eks_cluster - Get detailed cluster info
  • get_eks_node_groups - List and describe node groups
  • scale_node_group - Scale node groups up/down

What Gets Created

When you generate and apply an EKS Terraform configuration, you get:

Networking

  • VPC with public and private subnets across 3 AZs
  • NAT Gateways for private subnet internet access
  • Internet Gateway for public subnets
  • Proper subnet tagging for EKS/ALB

EKS Cluster

  • EKS control plane with specified Kubernetes version
  • IRSA (IAM Roles for Service Accounts) enabled
  • Managed node group with auto-scaling
  • EBS CSI driver (optional)
  • Security groups configured

IAM

  • EKS cluster IAM role
  • Node group IAM role
  • IRSA OIDC provider
  • EBS CSI driver IAM role (if enabled)
  • Cluster Autoscaler IAM role (if enabled)

Prerequisites

  • Python 3.10+
  • Terraform >= 1.0
  • AWS CLI configured
  • kubectl installed
  • Helm (for add-on installation)
  • boto3 Python library

Installation

cd ~/.mcp-servers/eks-mcp-server
pip install -r requirements.txt

Configuration

Add to ~/.claude/settings.json:

{
  "mcpServers": {
    "eks": {
      "command": "python3",
      "args": ["/Users/youruser/.mcp-servers/eks-mcp-server/server.py"],
      "env": {
        "EKS_WORKSPACE": "/Users/youruser/eks-clusters"
      }
    }
  }
}

Usage Examples

Create a New EKS Cluster

User: "Generate Terraform for an EKS cluster named production-cluster in us-west-2 with Kubernetes 1.29"

User: "Use t3.large instances with 3 nodes minimum and 10 maximum"

User: "Enable EBS CSI driver and cluster autoscaler"

Claude: [generates complete Terraform configuration]

User: "Initialize and plan the Terraform"

Claude: [runs terraform init and plan]

User: "Apply the configuration"

Claude: [creates the entire EKS cluster]

User: "Configure kubectl for this cluster"

Claude: [updates kubeconfig]

Manage Existing Cluster

User: "List all EKS clusters in us-east-1"

User: "Describe the production-cluster"

User: "Show me the node groups"

User: "Scale the node group to 5 desired nodes"

User: "Install the AWS Load Balancer Controller"

User: "Install metrics-server"

Upgrade Cluster

User: "Upgrade production-cluster to Kubernetes 1.30"

Claude: [initiates rolling upgrade]

Generated Terraform Structure

~/eks-clusters/
└── my-cluster/
    ├── main.tf       # VPC, EKS, node groups, IRSA
    ├── variables.tf  # Configurable parameters
    └── outputs.tf    # Cluster endpoints, IDs, kubectl command

Terraform Modules Used

  • terraform-aws-modules/vpc/aws - Production-ready VPC
  • terraform-aws-modules/eks/aws - EKS cluster and node groups
  • terraform-aws-modules/iam/aws - IRSA IAM roles

Default Configuration

  • VPC CIDR: 10.0.0.0/16
  • Subnets: 3 public + 3 private (one per AZ)
  • Node Instance Type: t3.medium
  • Node Count: 2 desired, 1-4 scaling range
  • Disk Size: 20 GB
  • Kubernetes Version: 1.29
  • IRSA: Enabled
  • EBS CSI Driver: Enabled

Add-on Installation

The server can install these add-ons via Helm or kubectl:

AWS Load Balancer Controller

Enables ALB and NLB ingress for your applications.

Metrics Server

Required for Horizontal Pod Autoscaler (HPA) and kubectl top.

Cluster Autoscaler

Automatically scales node groups based on pod resource requests.

External DNS

Automatically creates Route53 DNS records for Ingresses.

Cert Manager

Automates TLS certificate management with Let's Encrypt.

Cluster Upgrade Process

When you upgrade a cluster:

  1. Control plane is upgraded first (rolling, zero-downtime)
  2. Add-ons may need updating to match new K8s version
  3. Node groups should be upgraded separately (after control plane)
  4. Update Terraform config and run eks_terraform_apply to upgrade nodes

Cost Considerations

Typical EKS cluster costs:

  • EKS Control Plane: $0.10/hour (~$73/month)
  • EC2 Nodes: Varies by instance type
    • t3.medium: ~$0.0416/hour (~$30/month per node)
    • t3.large: ~$0.0832/hour (~$60/month per node)
  • NAT Gateways: $0.045/hour per AZ (~$32/month each)
  • Data Transfer: Varies

Cost Optimization:

  • Use single NAT Gateway for dev environments
  • Enable cluster autoscaler to scale down during off-hours
  • Use Spot instances for fault-tolerant workloads
  • Right-size instance types based on actual usage

Security Best Practices

  • Enable cluster logging (CloudWatch)
  • Use private API endpoint for production
  • Implement Pod Security Standards
  • Enable secrets encryption using KMS
  • Use IRSA instead of instance profiles
  • Regular security updates (upgrade K8s version)
  • Network policies to restrict pod communication
  • Use AWS WAF with ALB

Troubleshooting

Terraform fails with "Error creating EKS Cluster"

  • Check AWS service quotas
  • Verify IAM permissions
  • Ensure region supports EKS

Node groups stuck in "CREATE_FAILED"

  • Check EC2 instance limits
  • Verify subnet has available IP addresses
  • Review node IAM role permissions

kubectl can't connect

  • Run configure_kubectl tool again
  • Verify AWS credentials are current
  • Check cluster endpoint is accessible

Add-on installation fails

  • Ensure Helm is installed
  • Verify kubectl is configured
  • Check cluster has internet access (for pulling images)

Environment Variables

  • EKS_WORKSPACE: Directory for Terraform projects (default: ~/eks-clusters)

Advanced Usage

Custom Node Group Configuration

User: "Generate EKS cluster with mixed instance types: t3.large and t3.xlarge, 5-20 nodes"

User: "Set disk size to 50GB"

Multi-Region

User: "Create EKS cluster in ap-southeast-1"

User: "List clusters in eu-west-1"

Tags

User: "Generate EKS cluster with tags: Environment=Production, Team=Platform, CostCenter=Engineering"

Terraform State Management

⚠️ Important: For production, configure remote state:

terraform {
  backend "s3" {
    bucket         = "my-terraform-state"
    key            = "eks/production/terraform.tfstate"
    region         = "us-east-1"
    encrypt        = true
    dynamodb_table = "terraform-locks"
  }
}

Next Steps After Cluster Creation

  1. Install core add-ons (metrics-server, AWS LB controller)
  2. Set up monitoring (Prometheus, Grafana)
  3. Configure logging (Fluent Bit → CloudWatch)
  4. Deploy sample application
  5. Set up CI/CD pipelines
  6. Implement GitOps (ArgoCD, Flux)

Resources

  • EKS Best Practices: https://aws.github.io/aws-eks-best-practices/
  • Terraform AWS EKS Module: https://registry.terraform.io/modules/terraform-aws-modules/eks/aws
  • EKS Documentation: https://docs.aws.amazon.com/eks/

Production-Ready EKS Clusters | Terraform + VPC + IRSA + Add-ons

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选