name: Publish to MCP Registry
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
id-token: write # Required for OIDC authentication
contents: read # Required for repository checkout
jobs:
publish-mcp:
name: Publish to MCP Registry
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Update server.json version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "Updating server.json version to $VERSION"
node -e "
const fs = require('fs');
const server = JSON.parse(fs.readFileSync('server.json', 'utf8'));
server.version = '$VERSION';
fs.writeFileSync('server.json', JSON.stringify(server, null, 2) + '\n');
"
- name: Download MCP Publisher
run: |
curl -L https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz -o mcp-publisher.tar.gz
tar -xzf mcp-publisher.tar.gz
chmod +x mcp-publisher
- name: Authenticate with MCP Registry (OIDC)
run: ./mcp-publisher login github-oidc
- name: Publish to MCP Registry
run: ./mcp-publisher publish --allow-deprecated-schema || true