π The fast, Pythonic way to build MCP servers and clients.
Remove no-op sse_read_timeout param from StreamableHttpTransport
Jeremiah Lowin36cbef68135e
diff --git a/fastmcp_slim/fastmcp/client/transports/http.py b/fastmcp_slim/fastmcp/client/transports/http.pyindex c785955dd..73caf3cd1 100644--- a/fastmcp_slim/fastmcp/client/transports/http.py+++ b/fastmcp_slim/fastmcp/client/transports/http.py@@ -3,7 +3,6 @@from __future__ import annotationsimport contextlib-import datetimeimport sslfrom collections.abc import AsyncIteratorfrom typing import Any, Literal, cast@@ -15,13 +14,10 @@ from mcp.shared._httpx_utils import McpHttpClientFactory, create_mcp_http_clientfrom pydantic import AnyUrlfrom typing_extensions import Unpack-import fastmcp as fastmcpfrom fastmcp.client.auth.bearer import BearerAuthfrom fastmcp.client.auth.oauth import OAuthfrom fastmcp.client.dependencies import get_http_headersfrom fastmcp.client.transports.base import ClientTransport, SessionKwargs-from fastmcp.exceptions import FastMCPDeprecationWarning-from fastmcp.utilities.timeout import normalize_timeout_to_timedeltaclass StreamableHttpTransport(ClientTransport):@@ -32,7 +28,6 @@ class StreamableHttpTransport(ClientTransport):url: str | AnyUrl,headers: dict[str, str] | None = None,auth: httpx.Auth | Literal["oauth"] | str | None = None,- sse_read_timeout: datetime.timedelta | float | int | None = None,httpx_client_factory: McpHttpClientFactory | None = None,verify: ssl.SSLContext | bool | str | None = None,):@@ -43,7 +38,6 @@ class StreamableHttpTransport(ClientTransport):headers: Optional headers to include in requests.auth: Authentication method - httpx.Auth, "oauth" for OAuth flow,or a bearer token string.- sse_read_timeout: Deprecated. Use read_timeout_seconds in session_kwargs.httpx_client_factory: Optional factory for creating httpx.AsyncClient.If provided, must accept keyword arguments: headers, auth,follow_redirects, and optionally timeout. Using **kwargs is@@ -80,20 +74,6 @@ class StreamableHttpTransport(ClientTransport):self._set_auth(auth)- if sse_read_timeout is not None:- if fastmcp.settings.deprecation_warnings:- import warnings-- warnings.warn(- "The `sse_read_timeout` parameter is deprecated and no longer used. "- "The new streamable_http_client API does not support this parameter. "- "Use `read_timeout_seconds` in session_kwargs or configure timeout on "- "the httpx client via `httpx_client_factory` instead.",- FastMCPDeprecationWarning,- stacklevel=2,- )- self.sse_read_timeout = normalize_timeout_to_timedelta(sse_read_timeout)-self.forward_incoming_headers: bool = False# SDK v2's streamable_http_client no longer exposes a get_session_iddiff --git a/fastmcp_slim/fastmcp/mcp_config.py b/fastmcp_slim/fastmcp/mcp_config.pyindex f7ef47553..286e34c56 100644--- a/fastmcp_slim/fastmcp/mcp_config.py+++ b/fastmcp_slim/fastmcp/mcp_config.py@@ -274,7 +274,6 @@ class RemoteMCPServer(BaseModel):self.url,headers=self.headers,auth=self.auth,- sse_read_timeout=self.sse_read_timeout,)