Skip to content

Support for assumed IAM role (chained credentials) in MCP proxy #176

Closed as not planned

Description

@slavhate

Describe the feature (Security related? please follow https://github.com/aws/mcp-proxy-for-aws/security/policy to report them to AWS Security directly.)

When configuring the MCP proxy with an AWS profile that uses an assumed IAM role (chained credentials), the connection fails with a timeout error.

Logs (Assumed Role Profile):

2026-02-12 16:07:44.808 [info] [eks-mcp] Configuration changed for MCP server, reconnecting
2026-02-12 16:07:44.809 [info] [eks-mcp] Registering MCP server and starting connection
2026-02-12 16:08:44.977 [info] [eks-mcp] MCP connection closed successfully
2026-02-12 16:08:44.978 [error] [eks-mcp] Error connecting to MCP server: MCP error -32001: Request timed out

However, when using an AWS profile backed by a direct IAM user (static credentials, no role assumption), the connection succeeds.

Logs (IAM User Profile):

2026-02-13 20:01:46.900 [info] [eks-mcp] MCP server is already connecting
2026-02-13 20:01:56.266 [info] [eks-mcp] Connected to server with transport type: Stdio
2026-02-13 20:01:58.092 [info] [eks-mcp] Successfully connected and synced tools and resources for MCP server

Expected Behavior:

The MCP proxy should support AWS profiles that use assumed IAM roles (including chained credentials), similar to how the AWS CLI and SDKs handle them.

Questions:

  • Are assumed-role profiles officially supported?
  • If not, is this a known limitation for security reasons?
  • Would supporting MFA-authenticated role sessions resolve security concerns?
  • Is there any additional configuration required for chained role profiles?

Use Case

I’m interested in using the fully managed EKS MCP server provided by AWS. In our organization, access to EKS and related resources is granted exclusively through assumed IAM roles.

I expect this is a common setup across many organizations, where IAM roles (rather than long-lived IAM user credentials) are required for interacting with AWS services. Enabling support for assumed-role profiles in the MCP proxy would therefore benefit a broader segment of the AWS community that relies on role-based access controls.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Activity

  1. vinodkumar-wagh commented on Feb 13, 2026

    @vinodkumar-wagh

    This will be much required feature to get going with EKS MCP server setup in our organization. MCP must support role assumption (or even MFA authentication) for that matter.

  2. nix-tkobayashi commented on May 8, 2026

    @nix-tkobayashi

    Root Cause Analysis

    I investigated this issue and found the root cause in sigv4_helper.py.

    _sign_request_hook is an async httpx event hook, but it calls two synchronous methods that can trigger blocking STS calls:

    1. session_holder.refresh_if_needed() — calls create_aws_session() which may involve STS
    2. session_holder.session.get_credentials() — triggers a blocking STS AssumeRole call for profiles with chained credentials (role assumption)

    Since these run directly on the asyncio event loop (not in a thread), the entire event loop is blocked for the duration of the STS call, causing the ~60 second timeout.

    Workaround (for anyone blocked on this)

    Pre-resolve the AssumeRole credentials and pass them explicitly to boto3.Session:

    # Resolve credentials synchronously before entering async context
    sts = boto3.client("sts")
    assumed = sts.assume_role(RoleArn=role_arn, RoleSessionName="mcp-session")["Credentials"]
    
    # Create session with explicit creds — get_credentials() returns immediately
    session = boto3.Session(
        aws_access_key_id=assumed["AccessKeyId"],
        aws_secret_access_key=assumed["SecretAccessKey"],
        aws_session_token=assumed["SessionToken"],
    )
    session_holder = SessionHolder(session)

    Fix

    I submitted #270 which adds asyncio.to_thread() wrappers for both blocking calls, keeping the event loop responsive.

  3. arnewouters commented on May 19, 2026

    @arnewouters
    Contributor

    I have not been able to reproduce this, my setup with chained credentials works. If this is still an issue, can you share your MCP configuration and what MCP client you are using? Do you have MFA enabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions