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) uvpackage manager (uv --version) — install viacurl -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-authmapping where supported. The assessment skills do not change access. During setup a principal with effectivePowerUserAccesscan 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
| Mode | Use When | AWS Credentials |
|---|---|---|
| IAM (default) | Standard AWS/EKS setup | Required |
| kubeconfig | OIDC auth, air-gapped, non-AWS K8s | Not 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:
IAMFullAccessAmazonVPCFullAccessAWSCloudFormationFullAccess- 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_guidanceget_eks_vpc_config,get_eks_insightsget_policies_for_role,add_inline_policysearch_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
| Assistant | Config File |
|---|---|
| Claude Code | .mcp.json (project) or ~/.claude.json (user, via claude mcp add -s user) |
| Cursor | Settings → 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
| Argument | Description |
|---|---|
--allow-write | Opt-in: enable create, replace, patch and delete operations (and stack generate/deploy/delete) (omit for read-only) |
--allow-sensitive-data-access | Opt-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-mode | iam (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
| Variable | Description | Default |
|---|---|---|
AWS_PROFILE | AWS credentials profile | default |
AWS_REGION | AWS region for EKS | None (uses default AWS region) |
EKS_AUTH_MODE | iam or kubeconfig | iam |
KUBECONFIG | Path to kubeconfig file | ~/.kube/config |
FASTMCP_LOG_LEVEL | Log verbosity | WARNING |
HTTP_PROXY / HTTPS_PROXY | Proxy settings | none |
Region pitfall: When used with the AWS-hosted proxy,
mcp-proxy-for-awssigns SigV4 againstus-west-2by default while the proxy's--regionflag falls back tous-east-1when unset — always set--region(andAWS_REGION) explicitly to the region of your clusters to avoid a region-mismatch failure.
Step 3: Verify Setup
- Restart your AI assistant
- Ask: "What EKS MCP tools are available?" (this server has no list-clusters tool)
- 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(supportscreate,read,replace,patch,deleteoperations)apply_yaml,generate_app_manifestget_pod_logs,get_k8s_eventslist_api_versions
IAM Mode Only
manage_eks_stacks— CloudFormation cluster managementget_cloudwatch_logs,get_cloudwatch_metrics,get_eks_metrics_guidance— observabilityget_eks_vpc_config— VPC configurationget_eks_insights— upgrade readinessget_policies_for_role,add_inline_policy— IAM managementsearch_eks_troubleshoot_guide— troubleshooting KB
Troubleshooting
| Issue | Solution |
|---|---|
| Permission errors | Verify IAM policy or kubeconfig RBAC |
| Tools not appearing | Restart IDE/CLI; check FASTMCP_LOG_LEVEL=DEBUG |
| K8s API errors | Verify the MCP caller and failed read as described in Step 3 |
| kubeconfig not found | Set KUBECONFIG env var to correct path |