Upgrading langchain-mcp-adapters from 0.2.1 to 0.3.0 causes the following error at import time:
ImportError: cannot import name 'streamable_http_client'
This happens because 0.3.0 relies on a newer mcp SDK API (streamable_http_client), but the installed mcp package is not automatically upgraded to a compatible version when langchain-mcp-adapters is bumped. Pip resolves langchain-mcp-adapters==0.3.0 successfully without pulling in a newer mcp, leaving the environment in a broken state.
Reproduction
- Start with an environment on
langchain-mcp-adapters==0.2.1 and an older mcp version (anything below the version that introduced streamable_http_client).
- Upgrade only
langchain-mcp-adapters:
pip install --upgrade langchain-mcp-adapters==0.3.0
- Import the package:
from langchain_mcp_adapters.client import MultiServerMCPClient
- Observe:
ImportError: cannot import name 'streamable_http_client'
Workaround
Manually upgrading mcp to 1.28.0 resolves the issue:
pip install --upgrade mcp==1.28.0
Root cause
The mcp version pin/constraint in langchain-mcp-adapters's packaging metadata for 0.3.0 does not appear to require a version of mcp new enough to expose streamable_http_client. As a result, pip does not pull in the needed mcp upgrade automatically, and users hit an import error unless they manually bump mcp themselves.
Suggested fix
Update the mcp dependency constraint in langchain-mcp-adapters (e.g. in pyproject.toml/setup.cfg) for the 0.3.0 release so that installing or upgrading to 0.3.0 automatically pulls in an mcp version that includes streamable_http_client (confirmed working at mcp==1.28.0 or later).
Versions
langchain-mcp-adapters: 0.2.1 to 0.3.0 (upgrade path)
mcp: broken before upgrade, working at 1.28.0
- Python: 3.12
Upgrading
langchain-mcp-adaptersfrom0.2.1to0.3.0causes the following error at import time:This happens because
0.3.0relies on a newermcpSDK API (streamable_http_client), but the installedmcppackage is not automatically upgraded to a compatible version whenlangchain-mcp-adaptersis bumped. Pip resolveslangchain-mcp-adapters==0.3.0successfully without pulling in a newermcp, leaving the environment in a broken state.Reproduction
langchain-mcp-adapters==0.2.1and an oldermcpversion (anything below the version that introducedstreamable_http_client).langchain-mcp-adapters:Workaround
Manually upgrading
mcpto1.28.0resolves the issue:Root cause
The
mcpversion pin/constraint inlangchain-mcp-adapters's packaging metadata for0.3.0does not appear to require a version ofmcpnew enough to exposestreamable_http_client. As a result, pip does not pull in the neededmcpupgrade automatically, and users hit an import error unless they manually bumpmcpthemselves.Suggested fix
Update the
mcpdependency constraint inlangchain-mcp-adapters(e.g. inpyproject.toml/setup.cfg) for the0.3.0release so that installing or upgrading to0.3.0automatically pulls in anmcpversion that includesstreamable_http_client(confirmed working atmcp==1.28.0or later).Versions
langchain-mcp-adapters: 0.2.1 to 0.3.0 (upgrade path)mcp: broken before upgrade, working at 1.28.0