AI Agents
How to migrate your MCP server to FastMCP 4 and the Python SDK 2
If your server imports mcp.server.fastmcp, upgrading the mcp package to version 2 breaks it: FastMCP was renamed MCPServer. You have two destinations, MCPServer or FastMCP 4, and both require moving host and port to run(), building MCPError from a code and a message, and replacing ctx.elicit, which fails on 2026-07-28 connections.