From 86c1976da2ed107767151fbf592023762ebbd277 Mon Sep 17 00:00:00 2001 From: Ricardo Ceci Date: Sun, 10 May 2026 16:12:55 -0300 Subject: [PATCH 1/2] Replace streamablehttp_client with streamable_http_client, former displays as deprecated --- docs/examples/python/mcp_calculator.py | 4 ++-- src/content/docs/examples/python/mcp_calculator.mdx | 4 ++-- .../docs/user-guide/concepts/tools/mcp-tools.mdx | 12 ++++++------ .../docs/user-guide/deploy/deploy_to_aws_lambda.mdx | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/examples/python/mcp_calculator.py b/docs/examples/python/mcp_calculator.py index 40eab4e9e..a222f3a32 100644 --- a/docs/examples/python/mcp_calculator.py +++ b/docs/examples/python/mcp_calculator.py @@ -10,7 +10,7 @@ import threading import time -from mcp.client.streamable_http import streamablehttp_client +from mcp.client.streamable_http import streamable_http_client from mcp.server import FastMCP from strands import Agent from strands.tools.mcp.mcp_client import MCPClient @@ -110,7 +110,7 @@ def main(): print("Connecting to MCP server...") def create_streamable_http_transport(): - return streamablehttp_client("http://localhost:8000/mcp/") + return streamable_http_client("http://localhost:8000/mcp/") streamable_http_mcp_client = MCPClient(create_streamable_http_transport) diff --git a/src/content/docs/examples/python/mcp_calculator.mdx b/src/content/docs/examples/python/mcp_calculator.mdx index 458012211..475e4fe8c 100644 --- a/src/content/docs/examples/python/mcp_calculator.mdx +++ b/src/content/docs/examples/python/mcp_calculator.mdx @@ -45,12 +45,12 @@ mcp.run(transport="streamable-http") Now let's walk through how to connect a Strands agent to our MCP server: ```python -from mcp.client.streamable_http import streamablehttp_client +from mcp.client.streamable_http import streamable_http_client from strands import Agent from strands.tools.mcp.mcp_client import MCPClient def create_streamable_http_transport(): - return streamablehttp_client("http://localhost:8000/mcp/") + return streamable_http_client("http://localhost:8000/mcp/") streamable_http_mcp_client = MCPClient(create_streamable_http_transport) diff --git a/src/content/docs/user-guide/concepts/tools/mcp-tools.mdx b/src/content/docs/user-guide/concepts/tools/mcp-tools.mdx index feaaa1ef2..2c9c42709 100644 --- a/src/content/docs/user-guide/concepts/tools/mcp-tools.mdx +++ b/src/content/docs/user-guide/concepts/tools/mcp-tools.mdx @@ -153,12 +153,12 @@ For HTTP-based MCP servers that use Streamable HTTP transport: ```python -from mcp.client.streamable_http import streamablehttp_client +from mcp.client.streamable_http import streamable_http_client from strands import Agent from strands.tools.mcp import MCPClient streamable_http_mcp_client = MCPClient( - lambda: streamablehttp_client("http://localhost:8000/mcp") + lambda: streamable_http_client("http://localhost:8000/mcp") ) with streamable_http_mcp_client: @@ -170,11 +170,11 @@ Additional properties like authentication can be configured: ```python import os -from mcp.client.streamable_http import streamablehttp_client +from mcp.client.streamable_http import streamable_http_client from strands.tools.mcp import MCPClient github_mcp_client = MCPClient( - lambda: streamablehttp_client( + lambda: streamable_http_client( url="https://api.githubcopilot.com/mcp/", headers={"Authorization": f"Bearer {os.getenv('MCP_PAT')}"} ) @@ -194,10 +194,10 @@ pip install mcp-proxy-for-aws Then you use it like any other transport: ```python -from mcp_proxy_for_aws.client import aws_iam_streamablehttp_client +from mcp_proxy_for_aws.client import aws_iam_streamable_http_client from strands.tools.mcp import MCPClient -mcp_client = MCPClient(lambda: aws_iam_streamablehttp_client( +mcp_client = MCPClient(lambda: aws_iam_streamable_http_client( endpoint="https://your-service.us-east-1.amazonaws.com/mcp", aws_region="us-east-1", aws_service="bedrock-agentcore" diff --git a/src/content/docs/user-guide/deploy/deploy_to_aws_lambda.mdx b/src/content/docs/user-guide/deploy/deploy_to_aws_lambda.mdx index bca080309..34fdfe07f 100644 --- a/src/content/docs/user-guide/deploy/deploy_to_aws_lambda.mdx +++ b/src/content/docs/user-guide/deploy/deploy_to_aws_lambda.mdx @@ -233,13 +233,13 @@ When using [Model Context Protocol (MCP)](../concepts/tools/mcp-tools.md) tools **Establish a new MCP connection for each Lambda invocation.** Creating the `MCPClient` object itself is inexpensive - the costly operation is establishing the actual connection to the server. Use context managers to ensure connections are properly opened and closed: ```python -from mcp.client.streamable_http import streamablehttp_client +from mcp.client.streamable_http import streamable_http_client from strands import Agent from strands.tools.mcp import MCPClient def handler(event, context): mcp_client = MCPClient( - lambda: streamablehttp_client("https://your-mcp-server.example.com/mcp") + lambda: streamable_http_client("https://your-mcp-server.example.com/mcp") ) # Context manager ensures connection is opened and closed safely @@ -256,13 +256,13 @@ def handler(event, context): For optimization, you can establish the connection at module level using `start()` to reuse it across Lambda warm invocations: ```python -from mcp.client.streamable_http import streamablehttp_client +from mcp.client.streamable_http import streamable_http_client from strands import Agent from strands.tools.mcp import MCPClient # Create and start connection at module level (reused across warm invocations) mcp_client = MCPClient( - lambda: streamablehttp_client("https://your-mcp-server.example.com/mcp") + lambda: streamable_http_client("https://your-mcp-server.example.com/mcp") ) mcp_client.start() From 133129636198d731f8874d48f186290f36822ae6 Mon Sep 17 00:00:00 2001 From: Ricardo Ceci Date: Sun, 10 May 2026 16:22:15 -0300 Subject: [PATCH 2/2] Streamablehttp client update to streamable_http_client --- src/content/docs/user-guide/concepts/tools/mcp-tools.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/user-guide/concepts/tools/mcp-tools.mdx b/src/content/docs/user-guide/concepts/tools/mcp-tools.mdx index 2c9c42709..22ba3b9b8 100644 --- a/src/content/docs/user-guide/concepts/tools/mcp-tools.mdx +++ b/src/content/docs/user-guide/concepts/tools/mcp-tools.mdx @@ -194,10 +194,10 @@ pip install mcp-proxy-for-aws Then you use it like any other transport: ```python -from mcp_proxy_for_aws.client import aws_iam_streamable_http_client +from mcp_proxy_for_aws.client import aws_iam_streamablehttp_client from strands.tools.mcp import MCPClient -mcp_client = MCPClient(lambda: aws_iam_streamable_http_client( +mcp_client = MCPClient(lambda: aws_iam_streamablehttp_client( endpoint="https://your-service.us-east-1.amazonaws.com/mcp", aws_region="us-east-1", aws_service="bedrock-agentcore"