sdk-python icon indicating copy to clipboard operation
sdk-python copied to clipboard

[DOCS] mcp.client.streamable_http switch from streamablehttp_client to streamable_http_client

Open maxrabin opened this issue 4 months ago • 4 comments

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

maxrabin avatar Jul 20 '26 07:07 maxrabin

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_client was added and streamablehttp_client was marked @deprecated("Use \streamable_http_client` instead."). Confirmed by inspecting the tagged source — v1.23.0 exposes only streamablehttp_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…), plus deploy_to_aws_lambda.mdx, examples/python/mcp_calculator.{py,mdx}.
  • Nuance: strands-py/pyproject.toml pins mcp>=1.23.0,<2.0.0. streamable_http_client does not exist on the 1.23.x floor, so a blind rename in the docs would give users still on 1.23.x an ImportError. Also note the SDK's own strands-py/src/strands/tools/mcp/mcp_client.py:37,1762,1852 still imports/uses streamablehttp_client internally, 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"):

  1. Docs-only, floor-safe: update the examples to streamable_http_client and add a one-line note that it requires mcp>=1.24.0 (the current docs floor allows 1.23.x). Smallest change, no dependency edit.
  2. Docs + floor bump: also raise the mcp floor to >=1.24.0 in strands-py/pyproject.toml so the docs and the supported range are consistent, and (optionally) migrate the internal mcp_client.py import 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.

lifelmy avatar Aug 24 '26 23:08 lifelmy

Hi @lifelmy feel free to take this, and tag me on the PR :)

mkmeral avatar Aug 27 '26 16:08 mkmeral

@strandly-the-agent create a pr to fix pls

mkmeral avatar Oct 06 '26 17:10 mkmeral

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.

strandly-the-agent avatar Oct 06 '26 18:10 strandly-the-agent