You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MCP Proxy for AWS serves as a lightweight, client-side bridge between MCP clients (AI assistants and developer tools) and backend AWS MCP servers.
5
+
The **MCP Proxy for AWS** package provides two ways to connect AI applications to MCP servers on AWS:
6
6
7
-
The proxy handles [SigV4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html) authentication using local AWS credentials and provides dynamic tool discovery, making it ideal for developers who want access to AWS Hosted SigV4 secured MCP Servers without complex gateway setups.
7
+
1.**MCP Proxy** - A lightweight, client-side bridge between MCP clients (AI assistants like Claude Desktop, Amazon Q Developer CLI) and MCP servers on AWS. (See [MCP Proxy](#mcp-proxy))
8
+
2.**MCP Client Library** - A Python library to programmatically connect popular AI agent frameworks (LangChain, LlamaIndex, Strands Agents, etc.) to MCP servers on AWS. (See [MCP Client Library](#mcp-client-library))
9
+
10
+
### When Do You Need This Package?
11
+
12
+
- You want to connect to **MCP servers on AWS** (e.g., using Amazon Bedrock AgentCore) that use AWS IAM authentication (SigV4) instead of OAuth
13
+
- You're using MCP clients (like Claude Desktop, Amazon Q Developer CLI) that don't natively support AWS IAM authentication
14
+
- You're building AI agents with popular frameworks like LangChain, Strands Agents, LlamaIndex, etc., that need to connect to MCP servers on AWS
15
+
- You want to avoid building custom SigV4 request signing logic yourself
16
+
17
+
### How This Package Helps
18
+
19
+
**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.
20
+
21
+
**The Solution:** This package bridges that gap by:
22
+
-**Handling SigV4 authentication automatically** - Uses your local AWS credentials (from AWS CLI, environment variables, or IAM roles) to sign all MCP requests using [SigV4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html)
23
+
-**Providing seamless integration** - Works with existing MCP clients and frameworks
24
+
-**Eliminating custom code** - No need to build your own MCP client with SigV4 signing logic
25
+
26
+
## Which Feature Should I Use?
27
+
28
+
**Use the MCP Proxy if you want to:**
29
+
- Connect MCP clients like Claude Desktop or Amazon Q Developer CLI to MCP servers on AWS with IAM credentials
30
+
- Add MCP servers on AWS to your AI assistant's configuration
31
+
- Use a command-line tool that runs as a bridge between your MCP client and AWS
32
+
33
+
**Use the MCP Client Library if you want to:**
34
+
- Build AI agents programmatically using popular frameworks like LangChain, Strands Agents, or LlamaIndex
35
+
- Integrate AWS IAM-secured MCP servers directly into your Python applications
36
+
- Have fine-grained control over the MCP session lifecycle in your code
*[Install the `uv` package manager](https://docs.astral.sh/uv/getting-started/installation/)
13
-
*[Install and configure the AWS CLI with credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)
42
+
*AWS credentials configured (via [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html), environment variables, or IAM roles)
14
43
* (Optional, for docker users) [Install Docker Desktop](https://www.docker.com/products/docker-desktop)
15
44
16
-
## Installation
45
+
---
17
46
18
-
### Using PyPi
47
+
##MCP Proxy
19
48
49
+
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.
Add the following configuration to your MCP client config file (e.g., for Amazon Q Developer CLI, edit `~/.aws/amazonq/mcp.json`):
79
112
**Note** Add your own endpoint by replacing `<SigV4 MCP endpoint URL>`
80
113
81
-
### Running from local - using uv
114
+
####Running from local - using uv
82
115
83
-
```
116
+
```json
84
117
{
85
118
"mcpServers": {
86
119
"<mcp server name>": {
@@ -108,9 +141,9 @@ Add the following configuration to your MCP client config file (e.g., for Amazon
108
141
}
109
142
```
110
143
111
-
### Using Docker
144
+
####Using Docker
112
145
113
-
```
146
+
```json
114
147
{
115
148
"mcpServers": {
116
149
"<mcp server name>": {
@@ -129,6 +162,123 @@ Add the following configuration to your MCP client config file (e.g., for Amazon
129
162
}
130
163
```
131
164
165
+
For additional proxy examples, see [`./examples/mcp-proxy`](./examples/mcp-proxy).
166
+
167
+
---
168
+
169
+
## MCP Client Library
170
+
171
+
The MCP Client Library 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.
172
+
173
+
### Integration Patterns
174
+
175
+
The library supports two integration patterns depending on your framework:
176
+
177
+
#### Pattern 1: Framework-Native MCP Integration
178
+
179
+
**Use with:** Frameworks that provide their own MCP client implementations accepting connection factories, e.g. Strands Agents SDK, Microsoft Agent Framework. The AWS IAM MCP Client provides the authenticated transport layer.
180
+
181
+
**Example - Strands Agents SDK:**
182
+
```python
183
+
from mcp_proxy_for_aws.client import aws_iam_mcp_client
184
+
185
+
iam_client_factory =lambda: aws_iam_mcp_client(
186
+
endpoint=mcp_url, # The URL of the MCP server
187
+
aws_region=region, # The region of the MCP server
188
+
aws_service=service # The underlying AWS service, e.g. "bedrock-agentcore"
189
+
)
190
+
191
+
with MCPClient(iam_client_factory) as mcp_client:
192
+
mcp_tools = mcp_client.list_tools_sync()
193
+
agent = Agent(tools=mcp_tools, ...)
194
+
```
195
+
196
+
**Example - Microsoft Agent Framework:**
197
+
```python
198
+
from mcp_proxy_for_aws.client import aws_iam_mcp_client
199
+
200
+
iam_client_factory =lambda: aws_iam_mcp_client(
201
+
endpoint=mcp_url, # The URL of the MCP server
202
+
aws_region=region, # The region of the MCP server
203
+
aws_service=service # The underlying AWS service, e.g. "bedrock-agentcore"
**Use with:** Frameworks that require direct access to MCP sessions, e.g. LangChain, LlamaIndex. The AWS IAM MCP Client provides the authenticated transport, and you can manually manage the MCP session lifecycle.
216
+
217
+
**Example - LangChain:**
218
+
```python
219
+
from mcp_proxy_for_aws.client import aws_iam_mcp_client
220
+
221
+
iam_client = aws_iam_mcp_client(
222
+
endpoint=mcp_url, # The URL of the MCP server
223
+
aws_region=region, # The region of the MCP server
224
+
aws_service=service # The underlying AWS service, e.g. "bedrock-agentcore"
225
+
)
226
+
227
+
asyncwith iam_client as (read, write, session_id_callback):
0 commit comments