-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
Description
Summary
Add support for custom httpx_client_factory parameter in MCPServerStreamableHttp to allow users to configure custom HTTP client behavior for MCP StreamableHTTP connections.
Motivation
The underlying streamablehttp_client function from the MCP library already supports an httpx_client_factory parameter, but the MCPServerStreamableHttp class in the agents library doesn't expose this functionality. This limits users' ability to configure custom HTTP client settings (e.g., custom SSL certificates, proxy settings, custom retry logic).
Proposed Solution
- Extend MCPServerStreamableHttpParams to include an optional httpx_client_factory parameter
- Update MCPServerStreamableHttp.init to accept and store the custom factory
- Modify create_streams() to pass the custom factory to streamablehttp_client
jonmckee