From 9bf8e0d986cf2755f7e7df6f31a37015e0cddfb9 Mon Sep 17 00:00:00 2001 From: Logan Besecker Date: Thu, 1 Oct 2026 04:24:25 -0700 Subject: [PATCH] Publish to the registry only on a 404, not on any non-200 The publish job checks whether server.json's version is already on the official MCP registry. The registry answered that check with a transient 500, the job read anything but 200 as "not published", and it tried to publish 1.0.1 again -- failing the run with "duplicate version" though the listing was fine. - 404 means publish; 200 means skip - A 5xx is retried four times with backoff - If it persists, the run skips publishing with a warning rather than failing; the next deploy checks again Closes #79 --- Pages affected: - [MCP Harbor](https://ai.mcpharbor.dev/) -- the registry this job lists on the official MCP registry. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/mcp-registry.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mcp-registry.yml b/.github/workflows/mcp-registry.yml index 156936b..d58035d 100644 --- a/.github/workflows/mcp-registry.yml +++ b/.github/workflows/mcp-registry.yml @@ -135,9 +135,22 @@ jobs: enc() { jq -rn --arg v "$1" '$v|@uri'; } name=$(jq -r .name server.json) version=$(jq -r .version server.json) - status=$(curl -s -o /dev/null -w '%{http_code}' "$api/$(enc "$name")/versions/$(enc "$version")") - echo "$name $version -> HTTP $status" - if [ "$status" = 200 ]; then echo "publish=false" >> "$GITHUB_OUTPUT"; else echo "publish=true" >> "$GITHUB_OUTPUT"; fi + # Only a 404 means "not published yet". Anything else -- a 5xx in + # particular -- is the registry having a moment, and publishing on it + # tries to publish a version that already exists and fails the run. + # Retry, then skip rather than guess: the next deploy checks again. + for attempt in 1 2 3 4; do + status=$(curl -s -o /dev/null -w '%{http_code}' "$api/$(enc "$name")/versions/$(enc "$version")") + echo "$name $version -> HTTP $status (attempt $attempt)" + case "$status" in 200|404) break ;; esac + sleep $((attempt * 5)) + done + case "$status" in + 404) echo "publish=true" >> "$GITHUB_OUTPUT" ;; + 200) echo "publish=false" >> "$GITHUB_OUTPUT" ;; + *) echo "::warning::Registry answered HTTP $status; not publishing this run." + echo "publish=false" >> "$GITHUB_OUTPUT" ;; + esac retire="" for old in $RETIRED_SERVER_NAMES; do state=$(curl -s "$api/$(enc "$old")/versions/latest?include_deleted=true" \