Skip to content

v0.21.15

v0.21.15 #52

name: Publish MCP Registry
on:
release:
types:
- published
workflow_dispatch:
inputs:
release_tag:
description: GitHub Release tag to publish metadata for, for example v0.16.5.
required: true
type: string
checkout_ref:
description: Optional branch, tag, or commit SHA to publish from. Defaults to the selected workflow ref.
required: false
type: string
permissions:
contents: read
id-token: write
jobs:
publish-mcp-registry:
name: Publish MCP Registry
runs-on: ubuntu-latest
timeout-minutes: 10
env:
MCP_PUBLISHER_VERSION: v1.8.1
MCP_PUBLISHER_ASSET: mcp-publisher_linux_amd64.tar.gz
MCP_PUBLISHER_SHA256: a06c9096dcb9727c13555b6be26c7effa707b01f06a4c561ba7a3635443cf2cc
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.inputs.checkout_ref || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '24.13'
- name: Resolve release metadata
id: meta
run: |
set -euo pipefail
PACKAGE_VERSION="$(node -p "JSON.parse(require('node:fs').readFileSync('package.json', 'utf8')).version")"
SERVER_VERSION="$(node -p "JSON.parse(require('node:fs').readFileSync('server.json', 'utf8')).version")"
TAG_NAME="${{ github.event.release.tag_name || github.event.inputs.release_tag }}"
VERSION="${TAG_NAME#v}"
if [ "$VERSION" != "$PACKAGE_VERSION" ]; then
echo "Release tag $TAG_NAME does not match package.json version $PACKAGE_VERSION" >&2
exit 1
fi
if [ "$VERSION" != "$SERVER_VERSION" ]; then
echo "Release tag $TAG_NAME does not match server.json version $SERVER_VERSION" >&2
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
shell: bash
# This job provisions pnpm via plain actions/setup-node, not the repo's
# ./.github/actions/setup-node-pnpm — so pnpm itself is never installed here,
# and `pnpm check:mcp-metadata` would fail before publishing. Keep the direct
# node invocation; it duplicates check:mcp-metadata's command deliberately.
- name: Check MCP metadata sync
run: node scripts/sync-mcp-metadata.mjs --check
- name: Install mcp-publisher
run: |
set -euo pipefail
PUBLISHER_ARCHIVE="$RUNNER_TEMP/$MCP_PUBLISHER_ASSET"
curl --fail --show-error --location --retry 3 \
--output "$PUBLISHER_ARCHIVE" \
"https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}/${MCP_PUBLISHER_ASSET}"
printf '%s %s\n' "$MCP_PUBLISHER_SHA256" "$PUBLISHER_ARCHIVE" | sha256sum --check --strict
tar -xzf "$PUBLISHER_ARCHIVE" -C "$RUNNER_TEMP" mcp-publisher
install -m 0755 "$RUNNER_TEMP/mcp-publisher" ./mcp-publisher
./mcp-publisher --version
shell: bash
- name: Authenticate to MCP Registry
run: ./mcp-publisher login github-oidc
- name: Publish server to MCP Registry
run: ./mcp-publisher publish server.json