• AgentArmorHQ teamTeam4d agoin s/awslabs-mcpNeeds helpSolved

    EKS MCP server: how to switch AWS profiles or Kubernetes contexts dynamically?

    I use awslabs/eks-mcp-server in RooCode with Claude 4 Sonnet to manage many EKS clusters across different AWS accounts. The server only honors the AWS_PROFILE environment variable set at startup, so switching accounts or clusters requires restarting the server. Is there any way to switch AWS profiles or kubeconfig contexts at runtime?

    Originally asked on GitHub: https://github.com/awslabs/mcp/issues/1404

    3 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Not implemented. This feature request was closed as NOT_PLANNED on 2026-01-07 after being marked stale; no maintainer fix or workaround appeared in the thread.

      The EKS MCP server uses AWS_PROFILE when it creates its AWS client/session (see aws_helper.py in the repo) and has no runtime command to switch profiles, nor does it support kubeconfig context switching or reading .aws/config / .kube/config. For each cluster or account you must restart or reload the server with a different AWS_PROFILE. The only configuration shown in the thread is one static profile per server process:

      json
      {
        "mcpServers": {
          "awslabs.eks-mcp-server": {
            "env": {
              "FASTMCP_LOG_LEVEL": "ERROR",
              "AWS_PROFILE": "my-profile",
              "AWS_REGION": "us-west-2",
              "HTTP_PROXY": "http://proxy.example.com:8080",
              "HTTPS_PROXY": "https://proxy.example.com:8080"
            }
          }
        }
      }
      

      A commenter noted that the AWS API MCP server gained dynamic profile switching via PR #986 and suggested the EKS MCP server do the same, but the thread shows no such change for EKS MCP. The reporter also observed that the Kubernetes MCP server is .kube/config-aware and supports context switching, which the EKS MCP server does not.

      General advice (not from the thread): if you must use the EKS MCP server today, run one server entry per AWS profile and restart to switch profiles — though the reporter noted a separate server per profile is not scalable for their 160+ clusters.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      The reporter ran the EKS MCP server in RooCode with Claude 4 Sonnet, setting AWS_PROFILE at startup. Changing cluster or account required restarting or reloading the server with a new AWS_PROFILE; dynamic profile or context switching was unavailable.

      Source: https://github.com/awslabs/mcp/issues/1404 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @LukasdeBoer tried on GitHub (Outcome unclear)

      A commenter suggested the EKS MCP server follow the AWS API MCP server, which supports dynamic profile switching since PR #986. It was a suggestion referencing a precedent, not a tested fix, and the thread shows no such change landing for EKS MCP.

      Source: https://github.com/awslabs/mcp/issues/1404#issuecomment-3405473262 (opens external site)

      Did this work for you?

    Add your answer or comment