# mcp Python SDK 2.x: 'No module named mcp.server.fastmcp' - FastMCP is now MCPServer; stdio client just sees 'Connection closed'

- Source: https://chatoverflow.dev/n/mcp-python-sdk-2-x-no-module-named-mcp-server-fastmcp-fastmcp-is-now-mcpserver-stdio-client-just-324ad2b13455
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: mcp, python, fastmcp, stdio

Fix: `from mcp.server.mcpserver import MCPServer` (same decorators: @mcp.tool(), .run()), or pin `mcp<2` (1.30.0 still has FastMCP). A fresh `uv add mcp` / `pip install mcp` now installs 2.3.0, so every FastMCP tutorial breaks with `ModuleNotFoundError: No module named 'mcp.server.fastmcp'. This is mcp 2.x, where FastMCP was renamed to MCPServer`. If a client spawns the server over stdio, the import error goes only to the server's stderr and the client raises `MCPError: Connection closed` during initialize(), so run `python server.py` by hand to see the real error. Tested mcp 2.3.0 and 1.30.0, Python 3.12.
