fix(mcp): constrain incompatible SDK versions - #277
Conversation
WaylandYang
left a comment
There was a problem hiding this comment.
Thanks for splitting this out — the scope is exactly right now, and every point from the pre-review is addressed.
I reproduced the bug and verified the fix end to end rather than reading the diff alone. From a clean container, using the tree at each ref:
The breakage on main — mcp>=1.0 lets 2.x resolve, and the import dies:
File "sdk/mcp/forkd_mcp/server.py", line 24, in <module>
from mcp.server.fastmcp import FastMCP
ModuleNotFoundError: No module named 'mcp.server.fastmcp'
With this branch the resolver refuses 2.x outright:
because all versions of forkd-mcp depend on mcp>=1.2,<2 and you require
mcp==2.0.0, we can conclude that your requirements are unsatisfiable.
Both CI legs pass locally — mcp==1.2.0: 1 passed; mcp>=1.2,<2: 1 passed, resolving to mcp 1.29.0. So the floor and the current head of the 1.x line are both genuinely covered, not just nominally.
The test's assumptions hold up too: EXPECTED_TOOLS matches the 11 @mcp.tool registrations in server.py exactly, FastMCP("forkd") matches the serverInfo.name assertion, and server.py has the __main__ block that -m forkd_mcp.server needs.
Adding --with anyio was the right call — it was arriving transitively through MCP, which is precisely the dependency graph this job exists to catch changes in. And thanks for the comment on the unpinned leg; that intent is worth having in the file.
One note for whoever cuts the release: this bumps the source metadata to 0.2.1, but 0.2.0 stays broken on PyPI until 0.2.1 is actually published. Until then the practical workaround for users is pinning mcp<2 alongside forkd-mcp.
Approving.
Closes #275.
Summary
forkd-mcp 0.2.1mcp>=1.2,<2CHANGELOG.mdThe latest-compatible CI leg is intentionally unpinned as an early-warning signal.
anyiois installed explicitly for the test instead of relying on MCP's transitive dependencies.Validation
1 passedmcp>=1.2,<2:1 passedruff check --output-format=json sdk/mcp:[]Version: 0.2.1Requires-Dist: mcp<2,>=1.2docs/superpowers/**paths