fix: migrate to mcp 2.x SDK (FastMCP -> MCPServer) - #27
Merged
Conversation
mcp 2.0.0 removes mcp.server.fastmcp; the replacement mcp.server.mcpserver.MCPServer has an identical API for this project's usage (tool decorator, instructions, run(transport='stdio')). All 8 tools register and all 67 tests pass against mcp 2.0.0. Require mcp>=2,<3 since the code now uses the v2-only module; keep uv.lock in sync.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe project now requires MCP v2. The server imports and instantiates ChangesMCP v2 migration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 203 203
=========================================
Hits 203 203 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
Fixes the CI failure on #25 (
ModuleNotFoundError: No module named 'mcp.server.fastmcp').Root cause: dependabot PR #25 relaxes the mcp constraint to allow 2.x, and mcp 2.0.0 removes
mcp.server.fastmcp— the module this server imports. All four test jobs (3.10–3.13) fail at collection.Fix: migrate to the v2 API. mcp 2.0.0 replaced
FastMCPwithmcp.server.mcpserver.MCPServer, whose API is identical for this project's usage:Verified
MCPServer.tool(),MCPServer.run(transport="stdio")and theinstructionskwarg have the same signatures in 1.x/2.x.Changes
src/commit_check_mcp/server.py— import + instantiateMCPServer(2 lines)pyproject.toml— requiremcp>=2,<3(the code now uses a v2-only module; keeping>=1.27would let pip resolve 1.x and break imports)uv.lock— regeneratedValidation
Supersedes #25 (close #25 after merging this).
Summary by CodeRabbit
New Features
Bug Fixes