mcpcost

mcp 2.x · python sdk

ModuleNotFoundError: No module named 'mcp.server.fastmcp'

mcp 2.0 renamed FastMCP to MCPServer and moved it from mcp.server.fastmcp to mcp.server.mcpserver. An import of mcp.server.fastmcp, or of a name below it, stops with ModuleNotFoundError. 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 daily probe does the same: it installs a package that stops with this error once more with this pin.

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.fastmcp 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

787 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. 694 of them start and list their tools when the probe installs them once more with mcp<2.

Start with mcp<2 (694)

Stop at start-up (93)

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.