Migrate MCP Registry Namespace #4
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: Migrate MCP Registry Namespace | |
| # One-time workflow to migrate from io.github.perplexityai/mcp-server | |
| # to ai.perplexity/mcp-server. Delete this file after migration. | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| migrate: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: production | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - 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 | |
| - name: Save original files | |
| run: | | |
| cp package.json package.json.orig | |
| cp server.json server.json.orig | |
| # Step 1: Remove remote URL from old server using GitHub OIDC | |
| - name: Login with GitHub OIDC (for old namespace) | |
| run: ./mcp-publisher login github-oidc | |
| - name: Publish old server without remotes | |
| continue-on-error: true | |
| run: | | |
| cat > server.json <<'EOF' | |
| { | |
| "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json", | |
| "name": "io.github.perplexityai/mcp-server", | |
| "title": "Perplexity API Platform (moved to ai.perplexity/mcp-server)", | |
| "description": "Real-time web search, reasoning, and research through Perplexity's API", | |
| "version": "0.7.1", | |
| "packages": [ | |
| { | |
| "registryType": "npm", | |
| "identifier": "@perplexity-ai/mcp-server", | |
| "version": "0.7.0", | |
| "transport": { | |
| "type": "stdio" | |
| } | |
| } | |
| ] | |
| } | |
| EOF | |
| node -e " | |
| const fs = require('fs'); | |
| const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); | |
| pkg.mcpName = 'io.github.perplexityai/mcp-server'; | |
| pkg.version = '0.7.0'; | |
| fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n'); | |
| " | |
| echo "Publishing old server (removing remote URL)..." | |
| ./mcp-publisher publish | |
| # Wait for registry to propagate the old server update | |
| - name: Wait for registry propagation | |
| run: | | |
| echo "Waiting 30 seconds for registry to propagate..." | |
| sleep 30 | |
| # Step 2: Publish new server with remote URL using DNS auth | |
| - name: Restore original files | |
| run: | | |
| cp package.json.orig package.json | |
| cp server.json.orig server.json | |
| - name: Login with DNS auth (for new namespace) | |
| run: | | |
| echo "${{ secrets.MCP_REGISTRY_PRIVATE_KEY }}" > key.pem | |
| ./mcp-publisher login dns --domain perplexity.ai --private-key "$(openssl pkey -in key.pem -noout -text | grep -A3 'priv:' | tail -n +2 | tr -d ' :\n')" | |
| rm key.pem | |
| - name: Publish new server with remotes | |
| run: | | |
| cat > server.json <<'EOF' | |
| { | |
| "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json", | |
| "name": "ai.perplexity/mcp-server", | |
| "title": "Perplexity API Platform", | |
| "description": "Real-time web search, reasoning, and research through Perplexity's API", | |
| "version": "0.8.1", | |
| "packages": [ | |
| { | |
| "registryType": "npm", | |
| "identifier": "@perplexity-ai/mcp-server", | |
| "version": "0.8.1", | |
| "transport": { | |
| "type": "stdio" | |
| } | |
| } | |
| ], | |
| "remotes": [ | |
| { | |
| "type": "streamable-http", | |
| "url": "https://mcp.perplexity.ai/mcp", | |
| "description": "Hosted Perplexity MCP server with HTTP transport. Set PERPLEXITY_API_KEY environment variable." | |
| } | |
| ] | |
| } | |
| EOF | |
| echo "Publishing new server (with remote URL)..." | |
| ./mcp-publisher publish | |
| - name: Verify migration | |
| run: | | |
| echo "=== Old server ===" | |
| curl -s "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.perplexityai/mcp-server" | head -c 500 | |
| echo "" | |
| echo "" | |
| echo "=== New server ===" | |
| curl -s "https://registry.modelcontextprotocol.io/v0.1/servers?search=ai.perplexity/mcp-server" | head -c 500 |