fix: replace deprecated streamablehttp_client with streamable_http_client#479
Open
Vedanshu Joshi (Vedanshu7) wants to merge 2 commits intolangchain-ai:mainfrom
Open
Conversation
…ient Migrates _create_streamable_http_session() to the new MCP SDK v1.27+ streamable_http_client(url, *, http_client, terminate_on_close) API, dropping the deprecated positional-argument form that triggers a DeprecationWarning at runtime. Headers, timeout, sse_read_timeout, auth, and httpx_client_factory are forwarded via an httpx.AsyncClient built by create_mcp_http_client (or a caller-supplied factory) so all existing config options are preserved. Adds tests/test_sessions.py with five unit tests (mocked transport) and one end-to-end smoke test (real FastMCP server) that asserts no DeprecationWarning is emitted. Closes langchain-ai#478
|
When will this PR be merged? I believe openinference-instrumentation-mcp is failing with me because of naming inconsistencies between the adapter and the SDK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
streamablehttp_client(positional-arg form) with the newstreamable_http_client(url, *, http_client, terminate_on_close)API introduced in MCP SDK v1.27+httpx.AsyncClientviacreate_mcp_http_client(or a caller-supplied factory) to carry headers, timeout, sse_read_timeout, and auth — preserving all existing config optionsDeprecationWarningthat users see at runtime when usingstreamable_httptransportCloses #478
Test plan
DeprecationWarningaboutstreamablehttp_clientis emittedmake lintpasses (ruff + format)