Skip to content
Latchkey

Publish to MCP Registry workflow (OpenOSINT/OpenOSINT)

The Publish to MCP Registry workflow from OpenOSINT/OpenOSINT, explained and optimized by Latchkey.

A

CI health: A - excellent

Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: OpenOSINT/OpenOSINT.github/workflows/publish-mcp-registry.ymlLicense MITView source

What it does

This is the Publish to MCP Registry workflow from the OpenOSINT/OpenOSINT repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: Publish to MCP Registry

on:
  release:
    types: [published]
  workflow_dispatch:

jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      contents: read
    steps:
      - uses: actions/checkout@v4

      - name: Install mcp-publisher
        run: |
          curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher
          sudo mv mcp-publisher /usr/local/bin/

      - name: Wait for PyPI to publish this version
        run: |
          VERSION=$(python3 -c "import json; d=json.load(open('.mcp/server.json')); print(d['packages'][0]['version'])")
          echo "Waiting for openosint $VERSION on PyPI..."
          for i in $(seq 1 40); do
            code=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/openosint/$VERSION/json")
            [ "$code" = "200" ] && { echo "openosint $VERSION is on PyPI"; exit 0; }
            echo "  try $i: got $code - retrying in 15s"
            sleep 15
          done
          echo "Timed out waiting for openosint $VERSION on PyPI (10 min elapsed)"
          exit 1

      - name: Publish to MCP Registry
        run: |
          mcp-publisher login github-oidc

          MAX_ATTEMPTS=5
          DELAYS=(15 30 60 120 120)

          for attempt in $(seq 1 $((MAX_ATTEMPTS + 1))); do
            out=$(mcp-publisher publish .mcp/server.json 2>&1) && code=0 || code=$?
            echo "$out"
            if [ $code -eq 0 ]; then
              echo "✅ MCP Registry publish succeeded"
              exit 0
            fi
            # Treat an already-registered version as idempotent success.
            if echo "$out" | grep -qi "duplicate version"; then
              echo "✅ Version already registered in MCP Registry (idempotent)"
              exit 0
            fi
            if [ $attempt -gt $MAX_ATTEMPTS ]; then
              echo "❌ mcp-publisher publish failed after $MAX_ATTEMPTS attempts"
              exit 1
            fi
            WAIT=${DELAYS[$((attempt-1))]}
            echo "⚠️  Attempt $attempt failed. Retrying in ${WAIT}s..."
            sleep "$WAIT"
          done

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: Publish to MCP Registry
 
on:
  release:
    types: [published]
  workflow_dispatch:
 
jobs:
  publish:
    timeout-minutes: 30
    runs-on: latchkey-small
    permissions:
      id-token: write
      contents: read
    steps:
      - uses: actions/checkout@v4
 
      - name: Install mcp-publisher
        run: |
          curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher
          sudo mv mcp-publisher /usr/local/bin/
 
      - name: Wait for PyPI to publish this version
        run: |
          VERSION=$(python3 -c "import json; d=json.load(open('.mcp/server.json')); print(d['packages'][0]['version'])")
          echo "Waiting for openosint $VERSION on PyPI..."
          for i in $(seq 1 40); do
            code=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/openosint/$VERSION/json")
            [ "$code" = "200" ] && { echo "openosint $VERSION is on PyPI"; exit 0; }
            echo "  try $i: got $code - retrying in 15s"
            sleep 15
          done
          echo "Timed out waiting for openosint $VERSION on PyPI (10 min elapsed)"
          exit 1
 
      - name: Publish to MCP Registry
        run: |
          mcp-publisher login github-oidc
 
          MAX_ATTEMPTS=5
          DELAYS=(15 30 60 120 120)
 
          for attempt in $(seq 1 $((MAX_ATTEMPTS + 1))); do
            out=$(mcp-publisher publish .mcp/server.json 2>&1) && code=0 || code=$?
            echo "$out"
            if [ $code -eq 0 ]; then
              echo "✅ MCP Registry publish succeeded"
              exit 0
            fi
            # Treat an already-registered version as idempotent success.
            if echo "$out" | grep -qi "duplicate version"; then
              echo "✅ Version already registered in MCP Registry (idempotent)"
              exit 0
            fi
            if [ $attempt -gt $MAX_ATTEMPTS ]; then
              echo "❌ mcp-publisher publish failed after $MAX_ATTEMPTS attempts"
              exit 1
            fi
            WAIT=${DELAYS[$((attempt-1))]}
            echo "⚠️  Attempt $attempt failed. Retrying in ${WAIT}s..."
            sleep "$WAIT"
          done
 

What changed

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow