Skip to content

Conversation

@mikeedjones
Copy link
Contributor

@mikeedjones mikeedjones commented Nov 20, 2025

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_factory parameter exposed when creating a MCPSessionManager in adk. Overlaps with #2966 but I don't believe that that PR's implementation will work. streamablehttp_client needs a client factory, not a client.

testing plan

Adds test checking that streamablehttp_client uses the custom httpx factory. Could also test that a factory which obeys the McpHttpClientFactory protocol 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.

mikeedjones and others added 22 commits September 23, 2025 09:18
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
… test_init_with_streamable_http_default_httpx_factory for clarity
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@adk-bot adk-bot added the mcp [Component] Issues about MCP support label Nov 20, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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>
@ryanaiagent ryanaiagent self-assigned this Nov 21, 2025
@ryanaiagent
Copy link
Collaborator

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.

@ryanaiagent ryanaiagent added the needs-review [Status] The PR is awaiting review from the maintainer label Nov 21, 2025
@ryanaiagent
Copy link
Collaborator

Hi @DeanChensj , can you please review this.

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

Labels

mcp [Component] Issues about MCP support needs-review [Status] The PR is awaiting review from the maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants