Skip to content

Commit ecee22a

Browse files
authored
Merge pull request #1592 from DeusData/fix/pin-mcp-publisher-download
ci(release): pin and verify the mcp-publisher download on every platform
2 parents a23db3c + 70b2994 commit ecee22a

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

‎.github/workflows/release.yml‎

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)