Skip to content

Publish MCP Registry #4

Publish MCP Registry

Publish MCP Registry #4

Workflow file for this run

name: Publish MCP Registry
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- name: Upgrade npm for trusted publishing
run: npm install -g npm@latest
- name: Run tests
run: npm test
- name: Type-check
run: npm run check
- name: Build package
run: npm run build
- name: Sync server.json version from package.json
shell: bash
run: |
VERSION="$(node -p "require('./package.json').version")"
node -e "const fs=require('fs'); const pkg=JSON.parse(fs.readFileSync('server.json','utf8')); pkg.version='${VERSION}'; pkg.packages=pkg.packages.map(p => ({...p, version:'${VERSION}'})); fs.writeFileSync('server.json', JSON.stringify(pkg, null, 2) + '\n');"
- name: Publish package to npm
run: npm publish --access public
- name: Install mcp-publisher
shell: bash
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
- name: Authenticate to MCP Registry
run: ./mcp-publisher login github-oidc
- name: Publish server to MCP Registry
run: ./mcp-publisher publish