fix: cap mcp below 2.0 so the MCP server can start - #7
Open
oncerune wants to merge 1 commit into
Open
Conversation
mcp 2.0.0 (released 2026-07-28) renamed McpError -> MCPError. fastmcp
still imports the old name in fastmcp/server/server.py, and declares only
mcp>=1.24.0 with no upper bound, so setup.sh's unpinned "mcp[cli]"
resolves to 2.x and server.py dies at import:
ImportError: cannot import name 'McpError' from 'mcp.shared.exceptions'
This affects fastmcp 3.x too, which trips over a different symbol
(request_ctx from mcp.server.lowlevel.server), so the cap is on mcp
rather than on a particular fastmcp version.
Because server.py's FliMCP import is wrapped in try/except ImportError,
the fallback `from fastmcp import FastMCP` fails the same way, and the
whole failure surfaces to MCP clients only as a bare
"-32000: Connection closed".
Also lists pydantic-settings explicitly: fastmcp 2.14.x imports it
without declaring it and relied on it arriving transitively via
mcp[cli], which no longer pulls it in. It is a no-op on fresh installs,
where fastmcp 3.x declares it via fastmcp-slim.
Verified with a clean venv: the updated install line resolves to
flights 0.9.0 / mcp 1.29.0 / fastmcp 3.4.5 and the server reaches
"Starting MCP server 'flightclaw'".
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
oncerune
marked this pull request as ready for review
July 30, 2026 19:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
As of
mcp2.0.0 (released 2026-07-28), a fresh./setup.shproduces an MCP server that cannot start. MCP clients report only:Running the server directly shows the real cause:
mcp2.0.0 renamedMcpErrortoMCPError.fastmcpstill imports the old name infastmcp/server/server.py, and declares onlymcp>=1.24.0with no upper bound.setup.shinstalls"mcp[cli]"unpinned, so pip resolves to 2.x and the import fails.Two things make this harder to diagnose than usual:
server.pywraps theFliMCPimport intry/except ImportError, so the fallbackfrom fastmcp import FastMCPfails for the same underlying reason and the original error is easy to misread as a missing optional dependency.pip checkreports no broken requirements, because the incompatibility is a renamed symbol rather than a version conflict.This is not specific to one
fastmcprelease.fastmcp3.4.5 also fails againstmcp2.0.0, on a different symbol:so the constraint belongs on
mcprather than on a particularfastmcpversion.Fix
Cap
mcpbelow 2.0 insetup.sh, and listpydantic-settingsexplicitly:The
pydantic-settingsentry is for existingfastmcp2.14.x environments. That version importspydantic_settingsinfastmcp/settings.pywithout declaring it as a requirement, and relied on it arriving transitively throughmcp[cli], which no longer pulls it in. On a fresh install this is a no-op, sincefastmcp3.x declares it properly viafastmcp-slim.README.mdis updated to match. Its setup section previously drifted fromsetup.shand also leftflightsunpinned.Verification
Clean virtualenv with the updated install line resolves to
flights0.9.0,mcp1.29.0,fastmcp3.4.5, and the server reaches:Confirmed against an existing
fastmcp2.14.1 environment as well, whereclaude mcp get flightclawgoes fromFailed to connecttoConnected.Notes
An alternative is to pin
fastmcpand letmcpfloat. That was not chosen because both currentfastmcpmajors are incompatible withmcp2.x, so the cap onmcpis the constraint that actually holds. It can be lifted oncefastmcpsupportsmcp2.x.