@@ -459,9 +459,36 @@ jobs:
459459 scripts/ci/gen-mcpb-registry-entries.sh server.json checksums.txt "$RELEASE_VERSION"
460460 cat server.json
461461
462+ # Pinned by version AND content hash: `latest` would let an upstream
463+ # release (or a compromised one) change what runs in the job that holds
464+ # the registry publish credential, and piping curl straight into tar
465+ # executes the payload before anything can verify it.
466+ #
467+ # One pin covers every platform. Upstream ships a checksums file for the
468+ # whole release, so we pin that file's own SHA-256 and verify whichever
469+ # asset this runner needs against it. Moving the job to a different OS or
470+ # architecture therefore needs no change here, and an unlisted asset
471+ # fails closed rather than installing unverified.
462472 - name : Install mcp-publisher
473+ env :
474+ MCP_PUBLISHER_VERSION : v1.8.1
475+ MCP_PUBLISHER_CHECKSUMS_SHA256 : f7937a7908096f63147658e13f0f63a393a1c9fc722a2d10017593940d36e59e
463476 run : |
464- curl -fsSL "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
477+ base="https://github.com/modelcontextprotocol/registry/releases/download/$MCP_PUBLISHER_VERSION"
478+ sums="registry_${MCP_PUBLISHER_VERSION#v}_checksums.txt"
479+ asset="mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz"
480+
481+ curl -fsSLo "$sums" "$base/$sums"
482+ echo "$MCP_PUBLISHER_CHECKSUMS_SHA256 $sums" | sha256sum -c -
483+
484+ curl -fsSLo "$asset" "$base/$asset"
485+ # Exact filename match: a substring match would also accept the
486+ # .sbom.json / .sigstore.json lines for the same asset.
487+ awk -v a="$asset" '$2 == a' "$sums" > expected.sha256
488+ test -s expected.sha256 || { echo "no checksum listed for $asset" >&2; exit 1; }
489+ sha256sum -c expected.sha256
490+
491+ tar xzf "$asset" mcp-publisher
465492
466493 - name : Authenticate to MCP Registry (GitHub OIDC)
467494 run : ./mcp-publisher login github-oidc
0 commit comments