Skip to content

Cap mcp[cli] < 2.0.0 to prevent startup crash under mcp 2.0 - #85

Open
thedomato wants to merge 1 commit into
robcerda:mainfrom
thedomato:fix/cap-mcp-cli-below-2.0
Open

Cap mcp[cli] < 2.0.0 to prevent startup crash under mcp 2.0#85
thedomato wants to merge 1 commit into
robcerda:mainfrom
thedomato:fix/cap-mcp-cli-below-2.0

Conversation

@thedomato

Copy link
Copy Markdown

Problem

The server fails to start under Claude Desktop with:

File ".../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 Python SDK released mcp 2.0.0 on 2026-07-28, which removed the mcp.server.fastmcp module (app.py, auth.py, and tools/auth.py all import from it).

pyproject.toml/requirements.txt pin mcp[cli]>=1.10.0 with no upper bound. The documented Claude Desktop launch —

uv run --with mcp[cli] --with-editable <dir> mcp run .../server.py

— builds a fresh, unpinned environment and resolves mcp to the newest match (2.0.0), so the import crashes before the server can serve. Claude Desktop surfaces this as the server disconnecting.

Fix

Cap mcp[cli]>=1.10.0,<2.0.0 in pyproject.toml and requirements.txt, and refresh uv.lock (resolves to mcp 1.13.1, which still ships mcp.server.fastmcp).

Verification

Reproduced the exact Claude Desktop launch path against this branch:

uv run --with 'mcp[cli]' --with-editable . python -c "import mcp.server.fastmcp; import monarch_mcp_server.server"
# resolved mcp: 1.13.1
# OK: server.py import chain loads, mcp.server.fastmcp present, cap holds

No ModuleNotFoundError. A proper migration to the mcp 2.0 API can follow separately; this restores startup in the meantime.

The MCP SDK's mcp 2.0.0 (2026-07-28) removed the mcp.server.fastmcp
module that app.py imports (`from mcp.server.fastmcp import FastMCP`).
Because mcp[cli] is pinned only as >=1.10.0 with no upper bound, the
`uv run --with mcp[cli] --with-editable . mcp run .../server.py` launch
used by Claude Desktop resolves a fresh env to 2.0.0 and crashes at
import time with:

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

before the server can serve, which Claude Desktop surfaces as the
server disconnecting. Capping at <2.0.0 resolves to the latest 1.x
(which still ships mcp.server.fastmcp) and restores startup. A proper
migration to the mcp 2.0 API can follow separately.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant