| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…e_http Customizing the streamable-HTTP client's headers/auth/timeout requires building an httpx2.AsyncClient, but the standardized factory (create_mcp_http_client), the McpHttpClientFactory protocol, and the default timeout constants only lived in the private mcp.shared._httpx_utils module. Re-export them from the public mcp.client.streamable_http module — where streamable_http_client itself lives — so building a custom client does not require importing a private module. Add a regression test asserting the public names resolve to the same objects as the private ones, and point the migration guide at the public import path. Refs modelcontextprotocol#3238
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Sorry, something went wrong.
Review feedback: the module-level __all__ added previously would have replaced Python's implicit star-import behavior and dropped previously exported names (SessionMessageOrError, DEFAULT_RECONNECTION_DELAY_MS, etc.) for any `from mcp.client.streamable_http import *` consumer. Drop __all__ and mark the re-exports with redundant aliases instead, which is additive only — the star-import surface is unchanged apart from the newly exported names. Refs modelcontextprotocol#3238
|
fixed. I removed the module-level __all__ and switched to redundant-alias re-exports (X as X), which keeps ruff's F401 satisfied while remaining purely additive. Verified locally that the star-import surface is unchanged apart from the newly exported names: diffing dir(m) (no-underscore names) before vs. after shows nothing lost — SessionMessageOrError, DEFAULT_RECONNECTION_DELAY_MS, CONNECTION_CLOSED, etc. are all still exported, and create_mcp_http_client / McpHttpClientFactory / the two timeout constants are added. |
Sorry, something went wrong.
|
Thanks for the contribution. This repository only keeps pull requests open when they're linked to an issue that a maintainer has assigned to the author — CONTRIBUTING.md explains why and how we work. This PR has been closed for now because you aren't currently assigned to #3238. If a maintainer would like this change as a PR from you, they'll assign you to #3238 and this PR will reopen automatically — there's nothing more you need to do. (If you opened the issue, this PR already shows up on its timeline.) There's no need to open a new PR — this one will be reopened. While it's closed, please push any updates as new commits rather than force-pushing, since GitHub can't reopen a PR whose branch has been rewritten. Maintainers: reopening this PR, removing the missing-issue-link label, or adding bypass-issue-check bypasses the check. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Implements the suggestion in #3238: re-export the HTTP-client helpers from a public module so that customizing the streamable-HTTP client (headers/auth/timeout) no longer requires importing the private mcp.shared._httpx_utils.
Since 2.0 removed the headers/timeout/auth kwargs from streamable_http_client, the only supported way to build a conforming httpx2.AsyncClient is create_mcp_http_client — but it, the McpHttpClientFactory protocol, and the default-timeout constants were only reachable via the private module.
Changes
Notes
Fixes #3238
Testing