Skip to content

Upgrading langchain-mcp-adapters from 0.2.1 to 0.3.0 breaks with ImportError: cannot import name 'streamable_http_client' due to missing mcp dependency bump #550

Description

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

  1. 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).
  2. Upgrade only langchain-mcp-adapters:
    pip install --upgrade langchain-mcp-adapters==0.3.0
    
  3. Import the package:
    from langchain_mcp_adapters.client import MultiServerMCPClient
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions