[DOCS] mcp.client.streamable_http switch from streamablehttp_client to streamable_http_client
Documentation Section
https://strandsagents.com/docs/user-guide/concepts/tools/mcp-tools/#streamable-http
Current State
The docs show examples for using streamablehttp_client but since https://github.com/modelcontextprotocol/python-sdk/pull/1177 (v1.24.0) this has been deprecated, replaced by streamable_http_client
Suggested Improvement
Update the examples to use streamable_http_client.
Rationale
The current docs use deprecated functionality.
Additional Context
No response
I'd like to take this docs correction. I verified the deprecation and one compatibility nuance that affects how the fix should be scoped:
- The MCP Python SDK renamed the transport in v1.24.0 (modelcontextprotocol/python-sdk#1177, merged 2025-12-10):
streamable_http_clientwas added andstreamablehttp_clientwas marked@deprecated("Use \streamable_http_client` instead."). Confirmed by inspecting the tagged source — v1.23.0 exposes onlystreamablehttp_client`; v1.24.0+ has both (old one deprecated). - The docs still use the deprecated name in 6 places in
site/src/content/docs/user-guide/concepts/tools/mcp-tools.mdx(lines 161/166/178/182…), plusdeploy_to_aws_lambda.mdx,examples/python/mcp_calculator.{py,mdx}. - Nuance:
strands-py/pyproject.tomlpinsmcp>=1.23.0,<2.0.0.streamable_http_clientdoes not exist on the 1.23.x floor, so a blind rename in the docs would give users still on 1.23.x anImportError. Also note the SDK's ownstrands-py/src/strands/tools/mcp/mcp_client.py:37,1762,1852still imports/usesstreamablehttp_clientinternally, so the source isn't broken — this is purely a docs-freshness fix.
Given that, I see two viable scopes and would like a maintainer steer before opening the PR (per CONTRIBUTING's "wait for maintainer confirmation"):
- Docs-only, floor-safe: update the examples to
streamable_http_clientand add a one-line note that it requiresmcp>=1.24.0(the current docs floor allows 1.23.x). Smallest change, no dependency edit. - Docs + floor bump: also raise the
mcpfloor to>=1.24.0instrands-py/pyproject.tomlso the docs and the supported range are consistent, and (optionally) migrate the internalmcp_client.pyimport off the deprecated symbol. Larger, touches runtime deps.
I'd default to option 1 unless you want the floor bump. Testing plan for whichever is chosen: build the docs site (site/) to confirm the examples render, and if the internal import is touched, run the MCP client test suite in strands-py. Which scope do you prefer?
I use a coding assistant to help; I review and take responsibility for the final change.
Hi @lifelmy feel free to take this, and tag me on the PR :)
@strandly-the-agent create a pr to fix pls
Opened #4938.
One scope note: a straight rename to streamable_http_client doesn't work. Its signature is (url, *, http_client=None, ...) with no headers=, and it doesn't exist on the mcp 1.23 floor. Meanwhile a fresh pip install strands-agents now resolves mcp 2.x, where streamablehttp_client is gone, so the current snippet is an ImportError, not just deprecated. The PR switches the examples to MCPClient(url=..., headers=...), which builds the transport for whichever mcp major is installed (verified end-to-end on 1.30 and 2.1.1), and keeps a one-line pointer to streamable_http_client for custom transports.