Skip to content

FastMCP import fails after httpx≥0.28 upgrade (TransportError removed) #1585

@ghbaud

Description

@ghbaud

Title: FastMCP import fails after httpx≥0.28 upgrade (TransportError removed)

  • MCP version: 1.20.0 (also happens on 1.18.x)
  • Python: 3.12.10 on Windows 11
  • Install method: local venv (pip install mcp[cli])

Steps to reproduce

  1. Create a fresh venv.
  2. pip install mcp[cli]>=1.2.0.
  3. Run python -m mcp.dev path/to/server.py or simply from mcp.server.fastmcp import FastMCP.

Observed error

from mcp.client.sse import sse_client
  File ".../site-packages/mcp/client/sse.py", line 10, in <module>
    from httpx_sse import aconnect_sse
  File ".../site-packages/httpx_sse/_exceptions.py", line 4, in <module>
    class SSEError(httpx.TransportError):
AttributeError: module 'httpx' has no attribute 'TransportError'

Notes

  • Resolver now picks httpx 0.28.1 + httpx-sse 0.4.3.
  • httpx ≥0.28 removed/renamed TransportError; httpx_sse still subclasses it.
  • Pinning httpx==0.26.0 avoids the crash but conflicts with MCP’s httpx>=0.27.1.
  • Temporary workaround is editing .venv/Lib/site-packages/httpx_sse/_exceptions.py to fall back to httpx.HTTPError; that isn’t sustainable.

Request
Please pin MCP’s dependency stack to a compatible combination (e.g. httpx<0.28) or bump the required httpx-sse version so it handles the API change. If an official workaround already exists, documenting it would help downstream users. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds reproneeds additional information to be able to reproduce bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions