-
Notifications
You must be signed in to change notification settings - Fork 16
AWS IAM MCP client with SigV4 auth #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously in our discussion, we were thinking if the mcp client or transport is the level of abstraction. But seems from the PR, in order to make this feature available to both mcp python sdk and fastmcp v2, the two SDKs needs to be handled separately.
Final comment, would you be able to update the README to include a section of using this feature with popular agent SDKs?
mcp_proxy_for_aws/client.py
Outdated
| auth = SigV4HTTPXAuth(session.get_credentials(), aws_service, region) | ||
|
|
||
| # Establish connection using MCP SDK's streamable HTTP client | ||
| async with streamablehttp_client( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is using the official streamablehttp_client.
Do you know if this will be compatible for the users using fastmcp 2.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the client uses the standard MCP SDK's streamablehttp_client, which speaks the core MCP protocol over HTTP. FastMCP 2.0 servers are MCP-compliant, so any standard MCP client, including this one, will work seamlessly.
If users want to use fastmcp.Client, they'd bypass aws_iam_mcp_client() and use SigV4HTTPXAuth directly.
789d63f to
c4a7dd6
Compare
|
@wzxxing re:
Absolutely. I'll update the README and will switch the PR to "ready for review" |
0820cf8 to
63091f7
Compare
|
There are some issues found by the CI: https://github.com/aws/mcp-proxy-for-aws/actions/runs/19081826894/job/54560828478?pr=65 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heya thank you for the great examples and the readme in this pass! Codewise I think we are pretty much good to go, but I have concerns about the naming. Due to trademark we shouldn't really have this as a seperate entity in the package. I provided some suggestions of how we could rephrase examples and READMES.
tldr: We can use MCP Proxy for AWS but MCP Client Library and similar would i believe require a new trademark, so to keep it simple lets rephrase.
|
Hi Dennis, I forgot to point you to the contributing guide. https://github.com/aws/mcp-proxy-for-aws/blob/main/CONTRIBUTING.md You need to run I see the CI failed because uv.lock file was deleted. |
Should be fixed |
16416bd to
0bcf608
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more changes:
- Add license header to examples
- Fix mcp-proxy-for-aws reference in examples.
0bcf608 to
a9dd648
Compare
tests/unit/examples/README.md
Outdated
| @@ -0,0 +1,58 @@ | |||
| # MCP Client Example Tests | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't need README in unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess I can remove it.
|
|
||
|
|
||
| @pytest.mark.unit | ||
| class TestMcpClientExamples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these should be covered by pyright, if the example code can be validated by pyright, we don't need to do these unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was the one who asked to add these. Imo lets leave them for now, we can pivot later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we can. but CI failed: https://github.com/aws/mcp-proxy-for-aws/actions/runs/19107321050/job/54594703458?pr=65
Co-authored-by: wzxxing <169175349+wzxxing@users.noreply.github.com> Signed-off-by: Dennis Traub <dennis.traub@gmail.com>
Co-authored-by: Leonardo Araneda Freccero <arangatang@users.noreply.github.com> Signed-off-by: Dennis Traub <dennis.traub@gmail.com>
Co-authored-by: Leonardo Araneda Freccero <arangatang@users.noreply.github.com> Signed-off-by: Dennis Traub <dennis.traub@gmail.com>
2a05470 to
be56338
Compare
Signed-off-by: Dennis Traub <dennis.traub@gmail.com>
b67a57f to
82385bb
Compare
Enables IAM (SigV4) authentication for MCP clients connecting to AWS-hosted MCP servers. This client is a drop-in replacement for existing MCP client usage and works with agent frameworks like Strands Agents, LangChain, LlamaIndex, and the Microsoft Agent Framework.
aws_iam_mcp_client: an async context manager creating a streamable MCP HTTP client signed with SigV4boto3.Sessionwith optional AWS region and profileSigV4HTTPXAuthwith resolved credentials, service, and regionstreamablehttp_clienthttpx_client_factoryfor transport customizationUnit tests cover:
boto3.Session(region/profile)SigV4HTTPXAuthFollow-ups: