Skip to content

Commit 25482b6

Browse files
committed
agent: rename streamablehttp_client -> streamable_http_client
The MCP Python SDK renamed the import from `streamablehttp_client` to `streamable_http_client` (PR modelcontextprotocol/python-sdk#1177). The old name is deprecated and has been removed from current main. Pyright/Windsurf flags it as deprecated. Signature is backward-compatible: `url` remains the only required arg and the context manager still yields a 3-tuple, so the destructuring `async with streamable_http_client(url) as (read, write, _):` still works without further changes.
1 parent 23fea4f commit 25482b6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

securelife_client_app/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Load environment variables from .env file
99
load_dotenv()
1010

11-
from mcp.client.streamable_http import streamablehttp_client
11+
from mcp.client.streamable_http import streamable_http_client
1212
from mcp.client.session import ClientSession
1313
from langchain_openai import ChatOpenAI
1414
from langchain_core.prompts import ChatPromptTemplate
@@ -26,7 +26,7 @@ def __init__(self, server_url="http://localhost:8765/mcp"):
2626

2727
async def _call_tool(self, tool_name: str, arguments: dict) -> dict:
2828
"""Connects via Streamable HTTP to the MCP server and handles async communication."""
29-
async with streamablehttp_client(self.server_url) as (read, write, _):
29+
async with streamable_http_client(self.server_url) as (read, write, _):
3030
async with ClientSession(read, write) as session:
3131
await session.initialize()
3232
result = await session.call_tool(tool_name, arguments=arguments)

0 commit comments

Comments
 (0)