Publish to the MCP Registry from the tag - #2
Merged
Conversation
The registry entry names a version and an image tag, both of which go stale the moment a new release ships. Keeping them right by hand means remembering to edit server.json, re-run `mcp-publisher login` through a device-code flow, and publish -- every time. That is a step that gets skipped, and a skipped step here means the registry advertises an old version indefinitely. So the tag does it. A second job rewrites `version` and the image tag from GITHUB_REF_NAME and publishes. It `needs: release` because the entry points at an image goreleaser has to have pushed first; publishing earlier would advertise something nobody can pull. Authentication is OIDC, so there is no registry token in this repository to store, rotate or leak -- the registry trusts the workflow identity directly. Tag pushes only. A workflow_dispatch run carries a branch name rather than a version, and its dry run pushes no image at all. The version left in server.json is now last release's by design; CI stamps it. README says so, because a lagging number in a committed file otherwise reads as a bug. CI also validates server.json on every PR. A tag release is the worst place to learn it is malformed: by then the image is pushed and the GitHub release is cut.
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.
Automates the registry publish that was done by hand for v0.4.0.
Why
The registry entry names a version and an image tag. Both go stale the moment a new release ships, and keeping them correct manually means: edit
server.json, runmcp-publisher loginthrough a device-code flow, publish. Every time. That step gets skipped, and skipping it means the registry advertises a stale version indefinitely.How
A second job in
release.ymlthatneeds: release, so it runs only after goreleaser has actually pushed the image — publishing an entry that points at an unpushed tag would advertise something nobody can pull.It rewrites both fields from
GITHUB_REF_NAMEand publishes:Verified against the 2025-12-11 schema with a simulated
v0.5.0tag — output validates, and both fields move together as they must.Auth is
login github-oidc, so there is no registry secret in this repo to store, rotate or leak. The registry trusts the workflow identity.Guarded to tag pushes only (
startsWith(github.ref, 'refs/tags/v')): aworkflow_dispatchrun carries a branch name rather than a version, and its dry run pushes no image.Consequence worth knowing
The
versioncommitted inserver.jsonis now last release's, and lags by one tag on purpose. The tag is the source of truth; the file is a template CI stamps. README says this explicitly, because a lagging number in a committed file otherwise reads as a bug and invites someone to "fix" it.Also
CI validates
server.jsonon every PR. A tag release is the worst possible place to discover it is malformed — by then the image is pushed and the GitHub release is cut.