Add MCP registry auto-publish (MCPB bundle via GitHub Actions OIDC) #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to MCP Registry | |
| on: | |
| push: | |
| tags: ["v*"] | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # OIDC auth to the MCP registry | |
| contents: write # create release + upload the .mcpb asset | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Resolve version + tag | |
| id: v | |
| run: | | |
| if [[ "$GITHUB_REF" == refs/tags/v* ]]; then | |
| V="${GITHUB_REF#refs/tags/v}" | |
| else | |
| V="$(jq -r .version manifest.json)" | |
| fi | |
| echo "version=$V" >> "$GITHUB_OUTPUT" | |
| echo "tag=v$V" >> "$GITHUB_OUTPUT" | |
| - name: Build MCPB bundle | |
| id: build | |
| run: | | |
| # Pin manifest version to the release version, then zip the bundle | |
| # (manifest.json must be at the archive root; we are dependency-free). | |
| jq --arg v "${{ steps.v.outputs.version }}" '.version=$v' manifest.json > m.tmp && mv m.tmp manifest.json | |
| zip -j ai-readiness.mcpb manifest.json mcp.js lib.js package.json | |
| SHA="$(sha256sum ai-readiness.mcpb | cut -d' ' -f1)" | |
| echo "sha256=$SHA" >> "$GITHUB_OUTPUT" | |
| echo "Built ai-readiness.mcpb sha256=$SHA" | |
| - name: Release + upload .mcpb | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG="${{ steps.v.outputs.tag }}" | |
| if gh release view "$TAG" >/dev/null 2>&1; then | |
| gh release upload "$TAG" ai-readiness.mcpb --clobber | |
| else | |
| gh release create "$TAG" ai-readiness.mcpb --title "$TAG — MCP server" \ | |
| --notes "AI-readiness MCP server bundle (MCPB) + official MCP registry publish." | |
| fi | |
| - name: Generate server.json | |
| run: | | |
| cat > server.json <<EOF | |
| { | |
| "\$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json", | |
| "name": "io.github.epistemedeus/ai-readiness", | |
| "title": "AI Readiness", | |
| "description": "Check whether a website is visible to AI search engines (ChatGPT, Perplexity, Claude, Google AI Overviews) and return a score + a specific fix for each gap.", | |
| "repository": { "url": "https://github.com/epistemedeus/ai-readiness", "source": "github" }, | |
| "websiteUrl": "https://samedaydesk.com/tools/ai-readiness", | |
| "version": "${{ steps.v.outputs.version }}", | |
| "packages": [ | |
| { | |
| "registryType": "mcpb", | |
| "identifier": "https://github.com/epistemedeus/ai-readiness/releases/download/${{ steps.v.outputs.tag }}/ai-readiness.mcpb", | |
| "fileSha256": "${{ steps.build.outputs.sha256 }}", | |
| "transport": { "type": "stdio" } | |
| } | |
| ] | |
| } | |
| EOF | |
| cat server.json | |
| - name: Install mcp-publisher | |
| run: | | |
| curl -L "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 | |
| ./mcp-publisher --version || true | |
| - name: Authenticate (GitHub OIDC) | |
| run: ./mcp-publisher login github-oidc | |
| - name: Publish to MCP Registry | |
| run: ./mcp-publisher publish |