-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Feat/expose mcps streamable http custom httpx factory parameter #3634
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?
Feat/expose mcps streamable http custom httpx factory parameter #3634
Conversation
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…x-factory-parameter
…x-factory-parameter
… test_init_with_streamable_http_default_httpx_factory for clarity
…x-factory-parameter
…x-factory-parameter
…x-factory-parameter
…x-factory-parameter
…x-factory-parameter
…x-factory-parameter
…x-factory-parameter
…x-factory-parameter
…x-factory-parameter
…om-httpx-factory-parameter
Summary of ChangesHello @mikeedjones, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request re-implements a previously reverted feature, allowing developers to provide a custom httpx_client_factory when initializing an MCPSessionManager for Streamable HTTP. This change significantly enhances flexibility by enabling fine-grained control over the underlying HTTP client, particularly for managing SSL certificate configurations, thereby resolving critical issues related to secure communication with MCP servers. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request effectively exposes the httpx_client_factory parameter to allow for custom HTTP client creation, which is a great way to enable features like custom SSL certificate handling. The implementation is clean, using a Protocol with @runtime_checkable for type safety with Pydantic, and the changes are correctly propagated to the underlying MCP client. The new tests provide good coverage for the change. I have one minor suggestion for the test suite to improve its clarity and consistency.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Hi @mikeedjones, Thank you for your contribution! We appreciate you taking the time to submit this pull request. Your PR has been received by the team and is currently under review. We will provide feedback as soon as we have an update to share. |
|
Hi @DeanChensj , can you please review this. |
Reopen of #2997 after the accepted changes in that PR were reverted by e15e19d
This PR addresses #3005 and #2963 to allow control over the ssl cert used when connecting to an mcp server by exposing the
httpx_client_factoryparameter exposed when creating aMCPSessionManagerin adk. Overlaps with #2966 but I don't believe that that PR's implementation will work.streamablehttp_clientneeds a client factory, not a client.testing plan
Adds test checking that
streamablehttp_clientuses the custom httpx factory. Could also test that a factory which obeys theMcpHttpClientFactoryprotocol produces valid behavior when the session is opened?related issues
#2227 and #2881 both request slightly different options to control the ssl certs used internally by adk. I think exposing a httpx factory is a good pattern which could be followed for those issues too.