mcp 2.x · python sdk
ImportError: cannot import name 'streamablehttp_client' from 'mcp.client.streamable_http'
mcp 2.0 removed the function streamablehttp_client, which mcp 1.x had marked as deprecated. The function to use is streamable_http_client, with an underscore after streamable. A package that was written for mcp 1.x and asks for mcp with no upper bound gets mcp 2.x from a plain install and stops at start-up.
You only want to start the server
Install the package with the Python SDK below 2. With uv:
uvx --with "mcp<2" <package>
With pip, in the environment of the server:
pip install "mcp<2"
In an MCP client config, put --with and mcp<2 in front of the package name in the args of uvx. The SDK keeps the 1.x line supplied with critical fixes.
You publish the server
You have two fixes. The fast one is an upper bound in the dependencies of the package, then a new release:
dependencies = ["mcp>=1.2,<2"]
The SDK's migration guide says the same: keep a <2 upper bound until you have moved your code. The full fix is the move to mcp 2.x. Before:
from mcp.client.streamable_http import streamablehttp_client
After:
import httpx2
from mcp.client.streamable_http import streamable_http_client
http_client = httpx2.AsyncClient(headers={...}, timeout=httpx2.Timeout(30, read=300), auth=my_auth)
async with http_client:
async with streamable_http_client(
url="http://localhost:8000/mcp",
http_client=http_client,
) as (read_stream, write_stream):
...- The new function gives two values, (read_stream, write_stream). The old one gave three.
- Headers, the timeout and auth go on an httpx2.AsyncClient that you give as http_client.
- mcp 2.x uses httpx2 and does not install httpx. Code that imports httpx and relied on mcp to install it stops with ModuleNotFoundError: No module named 'httpx'.
- An import of GetSessionIdCallback also stops with ImportError.
Source: the section of the migration guide of the MCP Python SDK. mcp 2.0.0 came to PyPI on 28 July 2026. The examples are the guide's own.
Servers with this error 2026-11-14
1 PyPI package server in the official MCP registry stopped with this error in the newest daily probe. The probe installs each package in a container as a client does, with no version pins, and starts it.
- io.github.gradion-ai/ipybox ipybox
Is your server in the list after a fix? Its page updates with the next weekly check of the package. How the probe works.
Other errors of mcp 2.x
- ModuleNotFoundError: No module named 'mcp.server.fastmcp'
- AttributeError: 'Server' object has no attribute 'list_tools'
- ImportError: cannot import name 'FastMCP' from 'mcp.server'
- ImportError: cannot import name 'McpError' from 'mcp.shared.exceptions'
All of them, with counts. The full list of changes is in the migration guide.