mcpcost

mcp 2.x · python sdk

ImportError: cannot import name 'FastMCP' from 'mcp.server'

mcp 2.0 renamed FastMCP to MCPServer, so mcp.server has no name FastMCP. It is the same change that stops an import of mcp.server.fastmcp. 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.server import FastMCP

mcp = FastMCP("Demo")

After:

from mcp.server.mcpserver import MCPServer

mcp = MCPServer("Demo")

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

10 PyPI package servers 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.

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

All of them, with counts. The full list of changes is in the migration guide.