Build releases with the pinned hatchling and a publish action that accepts Metadata 2.5
The v2.1.0 Publishing run built fine but the upload step rejected the distributions before anything reached PyPI:
Checking dist/mcp-2.1.0-py3-none-any.whl: ERROR InvalidDistribution: Invalid distribution metadata: '2.5' is not a valid metadata version
Motivation and Context
Two things combined:
- The build job runs uv 0.9.5, which does not apply
[tool.uv].build-constraint-dependenciestouv build. Thehatchling==1.29.0pin inpyproject.tomltherefore never applied to release builds (the 2.0.0 wheel on PyPI saysGenerator: hatchling 1.31.0), and since hatchling 1.32.0 (2026-08-11) the floating build writesMetadata-Version: 2.5. - The publish step is pinned to
gh-action-pypi-publishv1.14.0, whose bundled metadata check predates 2.5. The v1.x workflow floats onrelease/v1(currently v1.14.2) and published a Metadata 2.5 wheel for v1.29.1 without complaint a few minutes earlier.
This bumps uv to 0.12.5 in the build job only, so the existing constraint takes effect (verified locally: uv 0.9.5 builds with hatchling 1.32.0 / Metadata 2.5; uv 0.11.15 and 0.12.5 build with hatchling 1.29.0 / Metadata 2.4, version-from-tag and the mcp-types== pin unchanged), and moves the publish action pin to v1.14.2 so a future metadata bump is not fatal either. The uv pin used by CI (shared.yml, conformance.yml) is left alone here.
How Has This Been Tested?
Rebuilt both packages from this branch with uv 0.9.5, 0.11.15 and 0.12.5 and compared METADATA/WHEEL; twine check --strict passes on all of them. The workflow itself only runs on release: published, so the real test is re-cutting v2.1.0 from the merge commit.
Breaking Changes
None.
Types of changes
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to change)
- Documentation update
Checklist
- I have read the MCP Documentation
- My code follows the repository's style guidelines
- New and existing tests pass locally
- I have added appropriate error handling
- I have added or updated documentation as needed