Pin mcp below v2 to fix pip resolution and avoid a breaking-API bump - #2216
Merged
Conversation
…API bump pydantic-ai-slim[mcp]'s fastmcp-slim dependency caps mcp<2.0 across its whole published range, so the previously-unbounded mcp>=1.28.1 pin was resolving to 1.x only by accident; Dependabot's mcp>=2.0.0 bump (PR #2207) directly contradicts that transitive cap and pip's resolver gives up with resolution-too-deep. mcp 2.0 also removes decorator-based handler registration from mcp.server.lowlevel.Server in favor of on_*= constructor kwargs, which opencontractserver/mcp/server.py does not speak yet (10 registration sites), so forcing the bump would break the MCP subsystem at ASGI import time. Explicit <2 pin documents the constraint until that migration is scoped.
|
Reviewed the diff ( Verified claims:
Minor/optional notes (non-blocking):
No functional/security/test-coverage concerns — this is a pure dependency-constraint fix with correct, verifiable rationale documented inline and in the changelog. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
requirements/base.txtpinsmcpto>=1.28.1,<2(was unbounded).mcp>=2.0.0) hits pip'sresolution-too-deep:pydantic-ai-slim[mcp]→fastmcp-slimcapsmcp<2.0across its whole published range, so the unbounded pin was only ever resolving to 1.x by transitive accident.mcp2.0 is also a breaking rewrite —mcp.server.lowlevel.Serverdrops decorator-based handler registration (@mcp_server.list_resources()etc.) foron_*=constructor kwargs with a new(ctx, params)signature.opencontractserver/mcp/server.pyuses the old decorator API at 10 registration sites acrosscreate_mcp_server()/create_scoped_mcp_server(), both of which run at Django/ASGI import time — forcing the bump would break the MCP subsystem at process startup, not just in CI.mcp2.x migration as its own scoped task oncefastmcp-slimships v2 support.Test plan
pip install --dry-runagainst the updatedrequirements/local.txtresolves cleanly (previouslyResolutionImpossible/resolution-too-deep).pre-commit run --files requirements/base.txtpasses.scripts/collate_changelog.py --check).