From d358f1bd213be59fd8c016e113b61ab56032354e Mon Sep 17 00:00:00 2001 From: Mark Mennell Date: Tue, 22 Sep 2026 14:31:15 +0800 Subject: [PATCH] Wait for npm to serve a release before registering it The v0.2.1 registry job started 8s after npm publish and failed with "version '0.2.1' was not found (status: 404)". Poll npm for up to five minutes before publishing to the MCP Registry. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/publish.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cfa6876..bf76fc6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -76,6 +76,19 @@ jobs: printf '%s %s\n' "$MCP_PUBLISHER_SHA256" "$publisher_dir/archive.tar.gz" | sha256sum --check --strict tar -xzf "$publisher_dir/archive.tar.gz" -C "$publisher_dir" mcp-publisher echo "$publisher_dir" >> "$GITHUB_PATH" + # The registry validates the npm version, which npm may not serve for a + # short while after the publish job finishes. + - name: Wait for npm to serve the release + env: + RELEASE_TAG: ${{ github.event.release.tag_name }} + run: | + package="$(node -p "require('./package.json').name")@${RELEASE_TAG#v}" + for attempt in $(seq 1 30); do + npm view "$package" version >/dev/null 2>&1 && exit 0 + sleep 10 + done + echo "$package not visible on npm after 5 minutes" >&2 + exit 1 - name: Authenticate to MCP Registry run: mcp-publisher login github-oidc - name: Publish server to MCP Registry