chore(deps): update uv: bump aiohttp from 3.14.3 to 3.14.4 (#443)
updated-dependencies:
- dependency-name: aiohttp dependency-version: 3.14.4 dependency-type: indirect …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
MCP Proxy for AWS
Overview
The MCP Proxy for AWS package provides two ways to connect AI applications to MCP servers on AWS:
When Do You Need This Package?
How This Package Helps
The Problem: The official MCP specification supports OAuth-based authentication, but MCP servers on AWS can also use AWS IAM authentication (SigV4). Standard MCP clients don’t know how to sign requests with AWS credentials.
The Solution: This package bridges that gap by:
Which Feature Should I Use?
Use as a proxy if you want to:
→ Install
mcp-proxy-for-aws-cli, the version-pinned CLI distribution: it freezes the entire dependency tree to tested versions. See MCP Proxy.Use as a library if you want to:
→ Install
mcp-proxy-for-aws, the library distribution: it keeps loose, co-resolvable dependency ranges so it resolves alongside your own dependencies. See Programmatic Access.Prerequisites
uvpackage managerMCP Proxy
The MCP Proxy serves as a lightweight, client-side bridge between MCP clients (AI assistants and developer tools) and IAM-secured MCP servers on AWS. The proxy handles SigV4 authentication using local AWS credentials and provides dynamic tool discovery.
Installation
Using PyPi
For CLI and
uvxuse, installmcp-proxy-for-aws-cli. It is a thin, version-pinned distribution: it freezes the proxy’s entire transitive dependency tree to tested versions, so a fresh install cannot silently pull in a newer — possibly compromised — release of a dependency. (The unsuffixedmcp-proxy-for-awsis the library distribution with loose, co-resolvable ranges, for importingmcp_proxy_for_awsin your own code — see Programmatic Access.)Note: Because
mcp-proxy-for-aws-clipins its entire dependency tree inside the package, even@latestinstalls a tested, frozen set. Check PyPI for available versions.Note: The first run may take tens of seconds as
uvxdownloads and caches dependencies. Subsequent runs will start in seconds. Actual startup time depends on your network and hardware.Using a local repository
Using Docker
Docker images are published to the public AWS ECR registry.
You can use the pre-built image:
Or build the image locally:
Configuration Parameters
endpointhttps://your-service.us-east-1.amazonaws.com/mcp)--service--profileaws_profiletool parameter (e.g.,--profile prod-readonly dev staging)AWS_PROFILEif--profileandAWS_MCP_PROXY_PROFILESare not set--regionAWS_REGIONenvironment variable if not set--metadata--metadata KEY1=value1 KEY2=value2)AWS_REGIONis automatically injected based on--regionif not provided--header--header x-tenant=acme --header x-trace=abc123). Sent as real HTTP headers and covered by the SigV4 signature; values are redacted from logs. Headers set by signing (authorization,date,x-amz-date,x-amz-security-token) are rejected.--read-onlyreadOnlyHint=true)False--retries--log-levelDEBUG/INFO/WARNING/ERROR/CRITICAL)INFO--timeout--connect-timeout--read-timeout--write-timeout--tool-timeout--skip-authFalse--disable-telemetryFalseOptional Environment Variables
Set the environment variables for the MCP Proxy for AWS:
Multi-account access
The proxy supports per-call AWS profile switching, allowing agents to work across multiple accounts without restarting.
Configuration:
How it works:
aws_profileparameter into auth-requiring toolsaws_profileon any call to route it through a specific profile’s credentialsaws_profileis omitted, the default (first) profile is usedExample MCP config (Kiro):
Setup Examples
Add the following configuration to your MCP client config file (e.g., for Kiro CLI, edit
~/.kiro/settings/mcp.json): Note Add your own endpoint by replacing<SigV4 MCP endpoint URL>Running from local - using uv
Using Docker
Using the pre-built public ECR image:
Or using a locally built image:
Programmatic Access
The MCP Proxy for AWS enables programmatic integration of IAM-secured MCP servers into AI agent frameworks. The library provides authenticated transport layers that work with popular Python AI frameworks.
By default, the library resolves AWS credentials automatically from the standard boto3 credential chain (environment variables, shared credentials file, etc.). You can optionally pass credentials programmatically via the
credentialsparameter. When provided, these take precedence over theaws_profileparameter. Note thataws_regionmust be explicitly specified when usingcredentials.Injecting Metadata
You can inject metadata into the MCP
_metafield on every request using themetadataparameter. This is useful for passing additional context to the server that cannot be sent as HTTP headers due to size limits.Integration Patterns
The library supports two integration patterns depending on your framework:
Pattern 1: Client Factory Integration
Use with: Frameworks that accept a factory function that returns an MCP client, e.g. Strands Agents, Microsoft Agent Framework. The
aws_iam_streamablehttp_clientis passed as a factory to the framework, which handles the connection lifecycle internally.Example - Strands Agents:
Example - Microsoft Agent Framework:
Pattern 2: Direct MCP Session Integration
Use with: Frameworks that require direct access to the MCP sessions, e.g. LangChain, LlamaIndex. The
aws_iam_streamablehttp_clientprovides the authenticated transport streams, which are then used to create an MCPClientSession.Example - LangChain:
Example - LlamaIndex:
Running Examples
Explore complete working examples for different frameworks in the
./examples/mcp-clientdirectory:Available examples:
Run examples individually:
Installation
For programmatic/library use, install
mcp-proxy-for-aws— the distribution with loose, co-resolvable dependency ranges. (For CLI/uvxuse, installmcp-proxy-for-aws-cliinstead, which pins the whole dependency tree — see MCP Proxy.)The client library is included when you install the package:
For development:
Troubleshooting
Authentication errors
We try to autodetect the service from the url, sometimes this fails, ensure that
--serviceis set correctly to the service you are attempting to connect to. Otherwise the SigV4 signing will not be able to be verified by the service you connect to, resulting in this error. Also ensure that you have valid IAM credentials on your machine before retrying.For long-running sessions, consider using long-lived credentials:
--profileaws sso loginbefore starting the proxyThe proxy reads fresh credentials from disk on every request, so credential refreshes and account switches take effect immediately — no restart or retry required. Simply refresh your credentials (e.g.,
aws sso login) and the next request will use them.Client hangs on tool calls
If your MCP client hangs waiting for a tool call response (e.g., due to an unresponsive endpoint), use
--tool-timeoutto set a maximum duration in seconds for each tool call. When the timeout is exceeded, the proxy returns a graceful error to the agent instead of hanging indefinitely.Unsigned requests
By default, the proxy signs all outgoing requests with SigV4 using your local AWS credentials. If you need to connect to an MCP endpoint that does not require SigV4 credentials (e.g., a local development server or a publicly accessible endpoint), use the
--skip-authflag:When
--skip-authis set, the proxy sends requests without signing them if AWS credentials are unavailable. If credentials are available, requests are still signed as usual — the flag only changes behavior when credentials cannot be resolved.Development & Contributing
For development setup, testing, and contribution guidelines, see:
Resources to understand SigV4:
License
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the “License”).
Disclaimer
LLMs are non-deterministic and they make mistakes, we advise you to always thoroughly test and follow the best practices of your organization before using these tools on customer facing accounts. Users of this package are solely responsible for implementing proper security controls and MUST use AWS Identity and Access Management (IAM) to manage access to AWS resources. You are responsible for configuring appropriate IAM policies, roles, and permissions, and any security vulnerabilities resulting from improper IAM configuration are your sole responsibility. By using this package, you acknowledge that you have read and understood this disclaimer and agree to use the package at your own risk.