Skip to main content
Source

This page is generated from skills/eks-mcp-server/references/self-hosted-setup.md. Edit the source, not this page.

Self-Hosted EKS MCP Server Setup

Part of: eks-mcp-server

The open-source EKS MCP server from awslabs/mcp runs locally on your machine, providing full control over authentication and configuration.

Prerequisites

  • Python 3.10+ (python3 --version)
  • uv package manager (uv --version) — install via curl -LsSf https://astral.sh/uv/install.sh | sh
  • For IAM mode: AWS CLI configured (aws configure list)
  • For kubeconfig mode: Valid kubeconfig with cluster access

Authentication Modes

ModeUse WhenAWS Credentials
IAM (default)Standard AWS/EKS setupRequired
kubeconfigOIDC auth, air-gapped, non-AWS K8sNot required

Step 1: Configure IAM (IAM Mode Only)

For IAM authentication, attach these permissions to your IAM role/user:

Read-Only Policy

{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"eks:DescribeCluster",
"eks:DescribeInsight",
"eks:ListInsights",
"ec2:DescribeVpcs",
"ec2:DescribeSubnets",
"ec2:DescribeRouteTables",
"cloudformation:DescribeStacks",
"cloudwatch:GetMetricData",
"logs:StartQuery",
"logs:GetQueryResults",
"iam:GetRole",
"iam:GetRolePolicy",
"iam:ListRolePolicies",
"iam:ListAttachedRolePolicies",
"iam:GetPolicy",
"iam:GetPolicyVersion",
"eks-mcpserver:QueryKnowledgeBase"
],
"Resource": "*"
}]
}

Write Operations

For write access (cluster creation, deployments), also attach:

  • IAMFullAccess
  • AmazonVPCFullAccess
  • AWSCloudFormationFullAccess
  • EKS Full Access: "Action": "eks:*"

Step 2: Configure Your AI Assistant

Basic Configuration (IAM Mode)

{
"mcpServers": {
"awslabs.eks-mcp-server": {
"command": "uvx",
"args": [
"awslabs.eks-mcp-server@latest",
"--allow-write",
"--allow-sensitive-data-access"
],
"env": {
"AWS_PROFILE": "default",
"AWS_REGION": "us-west-2",
"FASTMCP_LOG_LEVEL": "ERROR"
}
}
}
}

Kubeconfig Mode (OIDC/Non-IAM)

{
"mcpServers": {
"awslabs.eks-mcp-server": {
"command": "uvx",
"args": [
"awslabs.eks-mcp-server@latest",
"--allow-write",
"--allow-sensitive-data-access"
],
"env": {
"EKS_AUTH_MODE": "kubeconfig",
"KUBECONFIG": "~/.kube/config",
"FASTMCP_LOG_LEVEL": "ERROR"
}
}
}
}

Note: In kubeconfig mode, AWS-specific tools are disabled:

  • manage_eks_stacks (CloudFormation)
  • get_cloudwatch_logs, get_cloudwatch_metrics
  • get_eks_vpc_config, get_eks_insights
  • get_policies_for_role, add_inline_policy

Read-Only Mode

Remove --allow-write and --allow-sensitive-data-access for safer operation:

"args": ["awslabs.eks-mcp-server@latest"]

Config File Locations by Assistant

AssistantConfig File
Amazon Q CLI~/.aws/amazonq/mcp.json
Claude Code.mcp.json (project) or ~/.claude.json (user, via claude mcp add -s user)
CursorSettings → Tools & MCP
Kiro~/.kiro/settings/mcp.json
VS Code (Cline)Cmd+Shift+P → MCP → User Config

Windows Users

Use this format for the args array:

"args": [
"--from", "awslabs.eks-mcp-server@latest",
"awslabs.eks-mcp-server.exe",
"--allow-write",
"--allow-sensitive-data-access"
]

Command-Line Arguments

ArgumentDescription
--allow-writeEnable create/update/delete operations
--allow-sensitive-data-accessEnable logs, events, secrets access

To switch between IAM and kubeconfig auth, set the EKS_AUTH_MODE env var (see Environment Variables below) — the JSON examples above use this approach.

Environment Variables

VariableDescriptionDefault
AWS_PROFILEAWS credentials profiledefault
AWS_REGIONAWS region for EKSNone (uses default AWS region)
EKS_AUTH_MODEiam or kubeconfigiam
KUBECONFIGPath to kubeconfig file~/.kube/config
FASTMCP_LOG_LEVELLog verbosityWARNING
HTTP_PROXY / HTTPS_PROXYProxy settingsnone

Region pitfall: When used with the AWS-hosted proxy, mcp-proxy-for-aws signs SigV4 against us-west-2 by default while the proxy's --region flag falls back to us-east-1 when unset — always set --region (and AWS_REGION) explicitly to the region of your clusters to avoid a region-mismatch failure.

Step 3: Verify Setup

  1. Restart your AI assistant
  2. Ask: "List my EKS clusters" or "What tools are available?"

Available Tools

Always Available

  • list_k8s_resources, manage_k8s_resource (supports create, read, update, delete operations — read replaces the older standalone read_k8s_resource tool)
  • apply_yaml, generate_app_manifest
  • get_pod_logs, get_k8s_events
  • list_api_versions

IAM Mode Only

  • manage_eks_stacks — CloudFormation cluster management
  • get_cloudwatch_logs, get_cloudwatch_metrics — observability
  • get_eks_vpc_config — VPC configuration
  • get_eks_insights — upgrade readiness
  • get_policies_for_role, add_inline_policy — IAM management
  • search_eks_troubleshoot_guide — troubleshooting KB

Troubleshooting

IssueSolution
Permission errorsVerify IAM policy or kubeconfig RBAC
Tools not appearingRestart IDE/CLI; check FASTMCP_LOG_LEVEL=DEBUG
K8s API errorsEnsure EKS access entry exists for your principal
kubeconfig not foundSet KUBECONFIG env var to correct path

References