From 3f549c7afcb79baf8e474058aced9873fa328ce0 Mon Sep 17 00:00:00 2001 From: choaticpixels <299949693+choaticpixels@users.noreply.github.com> Date: Sat, 24 Oct 2026 11:49:33 -0700 Subject: [PATCH] Registry workflow: wait for the npm version to appear before publishing A publish run right after npm publish failed validation because the new version was not visible yet. Poll npm (up to 5 minutes) first. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/publish-registry.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/publish-registry.yml b/.github/workflows/publish-registry.yml index 0da5d91..700f599 100644 --- a/.github/workflows/publish-registry.yml +++ b/.github/workflows/publish-registry.yml @@ -19,6 +19,16 @@ jobs: - name: Install mcp-publisher run: | curl -sSL "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher + # The registry verifies the npm version exists, and a fresh publish can take a minute to appear. + - name: Wait for the npm version in server.json + run: | + name=$(node -p "require('./server.json').packages[0].identifier") + version=$(node -p "require('./server.json').packages[0].version") + for i in $(seq 1 30); do + if npm view "$name@$version" version >/dev/null 2>&1; then echo "$name@$version is on npm"; exit 0; fi + echo "waiting for $name@$version ($i/30)"; sleep 10 + done + echo "$name@$version never appeared on npm"; exit 1 - run: ./mcp-publisher validate - run: ./mcp-publisher login github-oidc - run: ./mcp-publisher publish