Skip to content

Commit 4010cf7

Browse files
authored
ci(release): list @vctrl/cli in the MCP Registry after the npm publish (#1205)
The registry grants an org namespace only to a token that can prove the org role, and its interactive login cannot (modelcontextprotocol/registry#1468), so io.github.Vectreal/vectreal has to be published from this job's OIDC token. The step runs after the npm publish, which the registry validates against, verifies mcp-publisher with cosign, and skips a version that is already listed.
1 parent 8526b49 commit 4010cf7

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

‎.github/workflows/cd-packages-release.yaml‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,3 +317,52 @@ jobs:
317317
( cd "$dir" && npm pack --dry-run )
318318
npx nx run "vctrl/$p:publish"
319319
done
320+
321+
# The MCP Registry listing for @vctrl/cli. It has to come from here: the
322+
# registry grants the io.github.Vectreal namespace through this job's OIDC
323+
# token, and its interactive login cannot publish to an org namespace
324+
# (modelcontextprotocol/registry#1468). The registry validates against the
325+
# npm package, so this runs after the publish above.
326+
- name: Install cosign
327+
uses: sigstore/cosign-installer@v4
328+
329+
- name: Download and verify mcp-publisher
330+
shell: bash
331+
env:
332+
MCP_PUBLISHER_VERSION: v1.8.2
333+
run: |
334+
set -euo pipefail
335+
archive="mcp-publisher_linux_amd64.tar.gz"
336+
base_url="https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}"
337+
curl --fail --location --silent --show-error --output "$archive" "$base_url/$archive"
338+
curl --fail --location --silent --show-error --output "$archive.sigstore.json" "$base_url/$archive.sigstore.json"
339+
cosign verify-blob \
340+
--bundle "$archive.sigstore.json" \
341+
--certificate-identity "https://github.com/modelcontextprotocol/registry/.github/workflows/release.yml@refs/tags/${MCP_PUBLISHER_VERSION}" \
342+
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
343+
"$archive"
344+
tar xzf "$archive" mcp-publisher
345+
rm -f "$archive" "$archive.sigstore.json"
346+
347+
- name: Publish @vctrl/cli to the MCP Registry (idempotent, OIDC)
348+
# server.json's version follows the CLI's through release-please's extra
349+
# files. Skipped when that version is already listed, so a re-run or a
350+
# manual dispatch does not fail on a duplicate.
351+
shell: bash
352+
run: |
353+
set -euo pipefail
354+
name=$(node -p "require('./packages/cli/server.json').name")
355+
version=$(node -p "require('./packages/cli/server.json').version")
356+
url="https://registry.modelcontextprotocol.io/v0.1/servers/${name//\//%2F}/versions/$version"
357+
status=$(curl --silent --output /dev/null --write-out '%{http_code}' "$url")
358+
if [[ "$status" == "200" ]]; then
359+
echo "✓ $name@$version already in the MCP Registry — skipping"
360+
exit 0
361+
fi
362+
if [[ "$status" != "404" ]]; then
363+
echo "Unexpected status $status from $url"
364+
exit 1
365+
fi
366+
echo "→ Publishing $name@$version to the MCP Registry"
367+
./mcp-publisher login github-oidc
368+
( cd packages/cli && ../../mcp-publisher publish )

0 commit comments

Comments
 (0)