Skip to content

Server fails to start: ModuleNotFoundError: No module named 'mcp.server.fastmcp' #84

Description

@yuryu

As of early August 2026, the server fails to start with ModuleNotFoundError: No module named 'mcp.server.fastmcp'. The MCP Python SDK v2 renamed FastMCP to MCPServer and moved mcp.server.fastmcp.* to mcp.server.mcpserver.* (see the v1→v2 migration guide). Because the recommended launch command uses an unpinned --with 'mcp[cli]', uv now resolves to SDK v2 and the import in app.py fails at startup.

Steps to reproduce

  1. Configure the server per the README, e.g.:
   uv run --with 'mcp[cli]' --with-editable /path/to/monarch-mcp-server mcp run /path/to/monarch-mcp-server/src/monarch_mcp_server/server.py
  1. Let uv resolve mcp[cli] to the latest version (now ≥2.0).
  2. Start the server (e.g., via Claude Desktop).

Expected behavior

Server starts and connects.

Actual behavior

Failed to run server
Traceback (most recent call last):
  File ".../site-packages/mcp/cli/cli.py", line 341, in run
    server = _import_server(file, server_object)
  File ".../site-packages/mcp/cli/cli.py", line 141, in _import_server
    spec.loader.exec_module(module)
  File ".../monarch-mcp-server/src/monarch_mcp_server/server.py", line 10, in <module>
    from monarch_mcp_server.app import mcp, main, app  # noqa: F401
  File ".../monarch-mcp-server/src/monarch_mcp_server/app.py", line 5, in <module>
    from mcp.server.fastmcp import FastMCP
ModuleNotFoundError: No module named 'mcp.server.fastmcp'

The MCP client (Claude Desktop) then reports "Server disconnected."

Environment

  • macOS (Apple Silicon), Python 3.13 via uv
  • mcp[cli] unpinned → resolves to SDK v2
  • Client: Claude Desktop

Workaround

Pin the SDK to v1 in the launch command:

--with 'mcp[cli]<2'

(or pin mcp<2 in pyproject.toml). This restores the previous behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions