fix(mcp): pin mcp<2.0.0 and report fastmcp removal accurately - #355
fix(mcp): pin mcp<2.0.0 and report fastmcp removal accurately#355erensh27 wants to merge 1 commit into
Conversation
| from mcp.server.fastmcp import FastMCP | ||
| except ModuleNotFoundError as exc: | ||
| try: | ||
| import mcp # noqa: F401 |
There was a problem hiding this comment.
Blocking: this catches every ModuleNotFoundError raised while importing FastMCP, including a missing transitive dependency inside an installed MCP 1.x package. Importing top-level mcp then succeeds and the code falsely reports that MCP 2.x removed FastMCP. Distinguish exc.name == "mcp", exc.name == "mcp.server.fastmcp", and unrelated missing modules, preserving the original error for the last case, and add tests for both incompatible-MCP and transitive-import failures.
rng1995
left a comment
There was a problem hiding this comment.
[Automated SkillSpector Review]
Requesting changes. The new error branch misdiagnoses missing transitive imports inside installed MCP 1.x as the MCP 2.x FastMCP removal, and the dependency change leaves uv.lock stale (uv lock --check fails). This branch also conflicts with main and substantially overlaps already-approved PR #339, which includes the lock and a focused regression.
mcp 2.0.0 (2026-07-28) removed mcp.server.fastmcp, so an install that resolved mcp 2.x fails at server init with the misleading 'requires the optional mcp dependency' error even though mcp is present. - Distinguish a missing 'mcp' package (missing optional extra) from an installed mcp package that lacks 'mcp.server.fastmcp' (incompatible mcp>=2.0.0), and re-raise the original error for unrelated missing modules such as a missing transitive dependency. - Add tests covering all three failure modes.
47f3abf to
7a055a4
Compare
|
All review comments addressed:
Verified: |
Fixes #333.
Two fixes:
mcpextra atmcp<2.0.0: mcp 2.0.0 (released 2026-07-28) removedmcp.server.fastmcp, so freshskillspector[mcp]installs could resolve mcp 2.x and then fail at server init.mcpitself is importable. If it is, the problem is the missingmcp.server.fastmcpsubmodule (mcp>=2.0.0), so the error now says so and points atpip install 'skillspector[mcp]'for a compatible pin, instead of the misleading "optional 'mcp' dependency is missing" message.Reproduction from the issue now yields a truthful error under mcp 2.x, and
pip install 'skillspector[mcp]'no longer resolves to mcp 2.x at all.