fix(deps): bound mcp below 2 so the built-in MCP servers import - #276
SproutSeeds wants to merge 1 commit into
Conversation
mcp 2.x removed mcp.server.fastmcp. The requirement mcp>=1.27.0 had no upper bound, so a fresh install without the arxiv extra, which is the path `npx -y get-physics-done` takes, resolved mcp 2.x and seven of the nine gpd-mcp-* entry points failed with ModuleNotFoundError. Installs with the arxiv extra avoided it only because arxiv-mcp-server 0.7.x declares mcp<2.0.0. Bound the requirement to mcp>=1.27.0,<2 until the servers move to the 2.x MCPServer API, and update the curated dependency assertions for pyproject.toml and uv.lock. Locked versions are unchanged. Refs psi-oss#273
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe project now requires ChangesMCP dependency bound
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The MCP version limit prevents fresh installs from selecting the documented incompatible 2.x API, while the locked version supports the built-in servers. No actionable merge risk remains. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new version bound addresses a documented server import incompatibility without changing the servers’ authority or exposing a new entry point. No PR-introduced security concern was established, though runtime compatibility has not been verified across every installation. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What changed
pyproject.toml:mcp>=1.27.0becomesmcp>=1.27.0,<2, with a comment giving the reason.uv.lock: the matchingrequires-distline. No locked versions change (relocked with uv 0.9.12, the CI version).tests/test_release_consistency.py: the two curated dependency assertions now expect the bound.CHANGELOG.md: avNEXTentry.Why
Fixes #273. mcp 2.x removed
mcp.server.fastmcp. Since mcp 2.0.0 shipped on July 28, a fresh install without extras resolves mcp 2.x, and seven of the ninegpd-mcp-*entry points fail withModuleNotFoundError. (The June date in the issue is 2.0.0a1, a prerelease that pip and uv skip by default.) This is the pathnpx -y get-physics-donetakes: it runspip install --upgrade get-physics-done==<version>in the managed environment.Installs with the
arxivextra avoid the break only becausearxiv-mcp-server0.7.x declaresmcp<2.0.0. The arxiv and Wolfram bridges use the low levelServerAPI and still import under mcp 2.2.0.This is option 1 from @sknob3l's report. Porting the servers to the 2.x
MCPServerAPI (option 2) can lift the bound later;tighten_registered_tool_contractsreaches into FastMCP internals, so that port is more than a rename.Testing done
At 8e1d10e, macOS arm64:
main'spyproject.tomlanduv.lockand pass here.uv run pytest tests/ -qon Python 3.11.13: 12945 passed, 7 skipped, 3 failed, with the same three failures on unmodifiedmain. Two are Codex projection budget assertions that count the bridge command, which embeds the checkout path (mine is 2 characters longer than CI's); the third needs a TeX package my TinyTeX lacks.ruff check .,uv lock --checkand the four generated surface--checkscripts pass.uv buildfrom this branch and frommain, installed into fresh venvs withpip install --upgrade <wheel>and no extras, on Python 3.11.13 and 3.13.9:initializeandlist_toolsover stdio.main: mcp 2.2.0; the seven FastMCP servers fail to import.arxivextra,gpd-mcp-arxivalso answers over stdio.gpd-mcp-wolframneedsGPD_WOLFRAM_MCP_API_KEY, so I did not exercise it.Until a release
The bound reaches
npxinstalls after the next PyPI release. Meanwhile, installingmcp<2into the managed environment at${GPD_HOME:-~/.gpd}/venvrestores the servers:A plain rerun of the installer keeps it, but
--reinstallresolves mcp 2.x again.Checklist
main)uv run ruff check .)vNEXTnote added)Summary by CodeRabbit