Skip to content

Commit 5a4c1be

Browse files
Avoid restricting the star-import surface; re-export via aliases
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 #3238
1 parent f9bde3a commit 5a4c1be

1 file changed

Lines changed: 4 additions & 23 deletions

File tree

src/mcp/client/streamable_http.py

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,14 @@
3333
from mcp.client._transport import TransportStreams
3434
from mcp.shared._compat import resync_tracer
3535
from mcp.shared._context_streams import ContextReceiveStream, ContextSendStream, create_context_streams
36-
from mcp.shared._httpx_utils import (
37-
MCP_DEFAULT_SSE_READ_TIMEOUT,
38-
MCP_DEFAULT_TIMEOUT,
39-
McpHttpClientFactory,
40-
create_mcp_http_client,
41-
)
36+
from mcp.shared._httpx_utils import MCP_DEFAULT_SSE_READ_TIMEOUT as MCP_DEFAULT_SSE_READ_TIMEOUT
37+
from mcp.shared._httpx_utils import MCP_DEFAULT_TIMEOUT as MCP_DEFAULT_TIMEOUT
38+
from mcp.shared._httpx_utils import McpHttpClientFactory as McpHttpClientFactory
39+
from mcp.shared._httpx_utils import create_mcp_http_client
4240
from mcp.shared.inbound import MCP_PROTOCOL_VERSION_HEADER
4341
from mcp.shared.jsonrpc_dispatcher import cancelled_request_id_from_params
4442
from mcp.shared.message import ClientMessageMetadata, SessionMessage
4543

46-
__all__ = [
47-
"LAST_EVENT_ID",
48-
"MAX_RECONNECTION_ATTEMPTS",
49-
"MCP_DEFAULT_SSE_READ_TIMEOUT",
50-
"MCP_DEFAULT_TIMEOUT",
51-
"MCP_SESSION_ID",
52-
"McpHttpClientFactory",
53-
"RequestContext",
54-
"ResumptionError",
55-
"StreamReader",
56-
"StreamWriter",
57-
"StreamableHTTPError",
58-
"StreamableHTTPTransport",
59-
"create_mcp_http_client",
60-
"streamable_http_client",
61-
]
62-
6344
logger = logging.getLogger(__name__)
6445

6546

0 commit comments

Comments
 (0)