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 in the range the chosen release declares (python3 --version; SKILL.md Step 1b reads it from PyPI)
  • 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
  • Kubernetes access for the MCP caller. For IAM-authenticated EKS reads, use an access entry with an appropriate policy or RBAC binding, or an existing aws-auth mapping where supported. The assessment skills do not change access. During setup a principal with effective PowerUserAccess can create its own entry.

AmazonEKSViewPolicy grants Kubernetes read permissions only, no IAM permissions, and covers most namespaced workload resources but not Secrets or most cluster-scoped and extension resources (for example nodes, persistentvolumes, storageclasses, ingressclasses, CRDs, admission webhook configurations, Gateway API resources and metrics.k8s.io); confirm each read through the MCP server (Step 3). Policy ARN: arn:aws:eks::aws:cluster-access-policy/AmazonEKSViewPolicy.

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": "*"
}]
}

logs:StartQuery and logs:GetQueryResults serve only get_cloudwatch_logs, which needs --allow-sensitive-data-access; drop them for a strict read-only profile.

Write Operations​

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

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

These are broad grants. Attach them only with the opt-in write profile below, and where you can, replace them with policies scoped to the clusters, stacks and roles the server manages (least privilege).

Step 2: Configure Your AI Assistant​

Basic Configuration (IAM Mode, read-only)​

<version> is the SKILL.md Step 1b result: latest, or the exact version the user pinned.

{
"mcpServers": {
"awslabs.eks-mcp-server": {
"command": "uvx",
"args": [
"awslabs.eks-mcp-server@<version>"
],
"env": {
"AWS_PROFILE": "default",
"AWS_REGION": "us-west-2",
"FASTMCP_LOG_LEVEL": "ERROR"
}
}
}
}

Kubeconfig Mode (OIDC/Non-IAM, read-only)​

{
"mcpServers": {
"awslabs.eks-mcp-server": {
"command": "uvx",
"args": [
"awslabs.eks-mcp-server@<version>"
],
"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_metrics_guidance
  • get_eks_vpc_config, get_eks_insights
  • get_policies_for_role, add_inline_policy
  • search_eks_troubleshoot_guide

Opt-in: Write Access and Sensitive-Data Reads​

The examples above are read-only with the sensitive-data flag off, the recommended start. Add only the flag you need; the example shows both (see Command-Line Arguments below): --allow-write for mutations (IAM mode: Kubernetes writes need a write-level EKS access entry or RBAC for your principal, with no IAM change; manage_eks_stacks and add_inline_policy also need the write IAM permissions above; kubeconfig mode: grant write RBAC), --allow-sensitive-data-access for logs, events and Secret reads through manage_k8s_resource.

"args": [
"awslabs.eks-mcp-server@<version>",
"--allow-write",
"--allow-sensitive-data-access"
]

--allow-sensitive-data-access puts pod logs, events, CloudWatch logs and Kubernetes Secrets (via manage_k8s_resource) into the model's context; --allow-write lets it change K8s resources, CloudFormation stacks and add new IAM inline policies to roles (it cannot modify existing ones; treat this as privilege escalation). Upstream: "Only enable these flags when necessary and in trusted environments" (EKS MCP Server README, Important Security Note).

Config File Locations by Assistant​

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

Windows Users​

Use this format for the args array (read-only):

"args": [
"--from", "awslabs.eks-mcp-server@<version>",
"awslabs.eks-mcp-server.exe"
]

For the opt-in profile, append only the flag(s) you need ("--allow-write", "--allow-sensitive-data-access") after the .exe entry.

Command-Line Arguments​

ArgumentDescription
--allow-writeOpt-in: enable create, replace, patch and delete operations (and stack generate/deploy/delete) (omit for read-only)
--allow-sensitive-data-accessOpt-in: enable logs, events and Kubernetes Secrets reads (still read-only). Omitting it does not hide Secrets from list_k8s_resources at 0.2.1 (see Available Tools); keep list on secrets out of the principal's RBAC (IAM mode: an access entry with AmazonEKSViewPolicy, not AmazonEKSAdminViewPolicy; kubeconfig mode: the view ClusterRole)
--auth-modeiam (default) or kubeconfig; same as EKS_AUTH_MODE, and takes precedence over it

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: "What EKS MCP tools are available?" (this server has no list-clusters tool)
  3. For EKS, compare the MCP connection's target endpoint (including the server's selected kubeconfig context) with aws eks describe-cluster --name <cluster> --region <region> before any Kubernetes request. For kubeconfig setups without AWS discovery, compare the selected endpoint with the operator-confirmed target. Stop if the match cannot be verified. Through the verified connection, test a required read such as listing nodes for cost or ingressclasses for ingress. If it fails, report the missing read. Where entries are enabled, aws eks list-access-entries --cluster-name <cluster> --region <region> can help diagnose the failure. An empty or denied listing alone does not establish whether the read is authorized.

Available Tools​

With no flags (the read-only examples above), manage_k8s_resource allows only read and manage_eks_stacks only describe; apply_yaml, generate_app_manifest, add_inline_policy and the other operations need --allow-write; get_pod_logs, get_k8s_events, get_cloudwatch_logs and manage_k8s_resource reads of a Secret need --allow-sensitive-data-access. Without the flag, these calls return an error. ConfigMaps and Pod specs, env values included, are readable without the flag. At 0.2.1 (checked 2026-11-08) list_k8s_resources is not gated (open upstream PR awslabs/mcp#4727 would gate kind Secret): for kind Secret it returns names, labels and annotations, and a Secret created with client-side kubectl apply carries its applied manifest, data included, in the kubectl.kubernetes.io/last-applied-configuration annotation. The upstream README marks get_eks_vpc_config and get_eks_insights as needing --allow-sensitive-data-access; the server code at 79267c6 does not enforce it (the tool descriptions still state the requirement, so the model may ask for the flag).

Both auth modes​

  • list_k8s_resources, manage_k8s_resource (supports create, read, replace, patch, delete operations)
  • 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, get_eks_metrics_guidance — 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 errorsVerify the MCP caller and failed read as described in Step 3
kubeconfig not foundSet KUBECONFIG env var to correct path

References​