Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion .github/workflows/mcp-registry-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 45
permissions:
id-token: write
contents: read
Expand Down Expand Up @@ -50,8 +51,41 @@ jobs:
mv server.json.tmp server.json
cat server.json

- name: Wait for npm to serve the release
# The registry rejects the entry unless npm already serves the version,
# and npm's read API lags publish by up to a minute.
env:
PACKAGE_NAME: "@browserstack/mcp-server"
run: |
VERSION="$(node -p 'require("./package.json").version')"
ENCODED="${PACKAGE_NAME/\//%2F}"
for attempt in $(seq 1 90); do
STATUS="$(curl -sS -o /dev/null -w '%{http_code}' \
"https://registry.npmjs.org/${ENCODED}/${VERSION}" || true)"
if [ "$STATUS" = "200" ]; then
echo "npm is serving ${PACKAGE_NAME}@${VERSION} (attempt ${attempt})."
exit 0
fi
echo "Attempt ${attempt}/90: npm returned ${STATUS} for ${VERSION}; retrying in 10s."
sleep 10
done
echo "::error::npm did not serve ${PACKAGE_NAME}@${VERSION} within 15 minutes."
exit 1

- name: Login to MCP Registry
run: ./mcp-publisher login github-oidc

- name: Publish to MCP Registry
run: ./mcp-publisher publish
run: |
for attempt in 1 2 3; do
if ./mcp-publisher publish; then
echo "Published to MCP Registry (attempt ${attempt})."
exit 0
fi
if [ "$attempt" -lt 3 ]; then
echo "Publish attempt ${attempt} failed; retrying in 5m."
sleep 300
fi
done
echo "::error::Failed to publish to the MCP Registry after 3 attempts."
exit 1
Loading