release
Cutting a milestone release
How versions and publishing work, and what to do when a publish fails, is
RELEASING.md. This skill is the procedure for one
milestone, start to finish. It is started by name only (/release), because a
release is never something to begin by inference.
A release is cut from main, after the milestone's work has been merged
there from v2/main. Nothing publishes from v2/main: release.yml refuses a
Release whose commit is not on main.
What stays human. Publishing the GitHub Release and approving the release
environment deployments are a maintainer's acts. So is merging any PR. Prepare,
verify and recommend; do not perform those.
0. Check this session's instructions first
A release is the longest-running session and the costliest to get wrong, and
it follows this skill and AGENTS.md exactly as they were when the session
started. Before step 1, run the staleness check in AGENTS.md
Issue-driven work style (all work in a worktree freshly cut from
origin/v2/main), whatever the SessionStart hook printed: the hook ran when
the session began, and this check runs now.
On STALE, or a STALE line from the SessionStart hook, stop and ask
for a session started in a fresh worktree. The v2.0.0 release ran its first
three steps on a release skill 447 commits out of date (#5167). Re-run the
check after each preparation PR merges, since v2/main moves under the
session, from the session-start revision, not HEAD: this flow moves
between worktrees (step 4e moves the verification worktree onto a newer
candidate), and a newer worktree's HEAD says nothing about the rules this
session loaded. The hook prints that revision and the re-check command.
The shape
One release issue, up to three preparation PRs on v2/main, one
merge PR into main, then the Release. In that order: each step needs
the one before it merged.
| | Preparation PRs | The merge PR |
| --- | --- | --- |
| Base | v2/main | main |
| Carries | The audit's forced fixes; the TypeScript version bumps; the Python version stamps | The milestone's work, arriving whole from v2/main. No commits of its own |
| References the release issue with | Closes #N (a cross-reference only, on v2/main) | Part of #N (non-closing: main is the default branch, where Closes would close the issue before anything is published) |
| Verified by | npm run local:gate, CI | npm run local:gate, plus npm run pack:verify, plus every milestone issue exercised, written up as the release ledger |
⚠️ Do not fold them together. A version bump made on the merge branch
exists only downstream of v2/main, and nothing carries it back: the develop
branch would keep reporting the previous version, and the next branch cut from
it would too.
1. The release issue
One per milestone, titled Release vX.Y.Z (the milestone's name), filed
through /issue-create: type chore, no server-scope label, the milestone it
releases. It is what every PR below references, so file it first.
Set its card to In Progress (/board-ops). It stays open until the Release
is published (step 6), whatever merges in between.
N=<RELEASE_ISSUE_NUMBER>
MILESTONE=vX.Y.ZCheck the milestone is complete before preparing anything. The only open
issue left in it should be the release issue itself:
gh issue list --repo modelcontextprotocol/servers --milestone "$MILESTONE" \
--state open --json number,title --jq '.[] | "#\(.number) \(.title)"'Anything else open is either finished first or moved to the next milestone by
a maintainer. Do not release around it silently.
2. Preparation PRs, on v2/main
All three are part of the milestone's work, so all three land on the develop
branch and reach main with everything else. **All are merged before the merge
PR is opened.** A milestone that touches only one language, with a clean audit,
has one.
Each branch this skill cuts by hand (the audit, the hand-run CalVer stamp, the
merge branch) goes into its own sibling worktree, as /pr-flow step 2
does, never by switching branches in the primary checkout. Run each recipe from
the primary checkout; the worktree is named for the checkout, the release
issue and the branch's role, since one issue owns several branches.
2a. The audit
Audit first, so the version bumps sit on a tree that was just checked.
git fetch origin v2/main
git worktree add --no-track "../$(basename "$PWD")-$N-audit" \
-b "v2/chore/$N-release-audit" origin/v2/main
cd "../$(basename "$PWD")-$N-audit" && npm install
# npm: one lockfile covers the root and all four TypeScript workspaces.
npm audit --audit-level=high
# Python: each server has its own lockfile. `uv` has no audit of its own in the
# version pinned here, so the locked requirements go through pip-audit.
# Exported to a file first: piped straight in, a failed `uv export` hands
# pip-audit empty input, which it reports as clean. And pip-audit exits
# non-zero both when it finds something and when it could not run, so a
# server counts as audited only when its output holds a verdict. The block
# runs in a subshell that exits non-zero if any server was not audited.
(
unaudited=
for s in fetch git time; do
echo "== $s"
REQ=$(mktemp) OUT=$(mktemp)
if (cd "src/$s" && uv export --frozen --no-emit-project --format requirements-txt) > "$REQ" \
&& [ -s "$REQ" ]; then
uvx pip-audit --require-hashes --disable-pip -r "$REQ" > "$OUT" 2>&1
cat "$OUT"
grep -qE 'No known vulnerabilities found|Found [0-9]+ known vulnerabilit' "$OUT"