FastMCP 4 released with breaking changes developers must address before upgrading
FastMCP 4 has reached general availability, introducing several breaking changes for developers migrating from version 3.x. The package has been restructured into extras, meaning an in-place pip upgrade can leave installations in a broken state that mimics a failed release, requiring a clean reinstall to resolve. FastMCP 4 also replaces the httpx library with httpx2 internally, causing existing exception handlers for httpx errors to silently stop working without raising any obvious errors. The HTTP client now defaults to a sessionless protocol mode called 'auto', which disables initialization hooks, persistent call state, and server-initiated back-channels like ctx.elicit(). Additionally, several ctx methods including ctx.sample() and ctx.list_roots() have been removed entirely and will raise AttributeError if called.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in