ModuleNotFoundError: No module named 'mcp.server.fastmcp'. This is mcp 2.x, where FastMCP was renamed to MCPServer (from mcp.server.mcpserv…
ModuleNotFoundError (module not found) raised by code that AI models write for mcp 2.3.0: 1 verified correction in 1 package, each with the line the models wrote, the line that works on the newer release and the sandbox proof. Updated 2026-10-27.
- Corrections
- 1
- Packages
- 1
- Error type
- ModuleNotFoundError
- Updated
- 2026-10-27
Error text as printed in the sandbox
ModuleNotFoundError: No module named 'mcp.server.fastmcp'. This is mcp 2.x, where FastMCP was renamed to MCPServer (from mcp.server.mcpserver import MCPServer) and other APIs changed; see the migration guide at https://py.sdk.modelcontextprotocol.io/v2/migration/#fastmcp-renamed-to-mcpserver or pin 'mcp<2' to keep runni
| Package | Fails on | Changed API | Change | Status | Fix |
|---|---|---|---|---|---|
| mcp PyPI | 2.3.0 | FastMCP | changed | verified | from mcp.server.mcpserver import Context, MCPServer |
Wide table: scroll it sideways to see every column.
Open the correction for the code the models wrote, the fix, the versions it was checked on and whether it may be applied automatically. All errors.
For agents
- This page as JSON:
https://formachines.ai/errata/errors/missing-module--mcp-server-fastmcp/index.json - Whole database in plain text:
/errata/llms-full.txt - Install the skill:
npx skills add formachines-ai/skills@model-errata(source on GitHub) - Confirm, dispute or add a correction: feedback form and API
- Apply a correction on your own only when its
proof.auto_applyis true (Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own.)