Merge pull request #42 from onkernel/mason/fix-mcp-publish #2
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 MCP server.json | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install MCP Registry Publisher | |
| run: | | |
| set -euo pipefail | |
| ARCH="$(uname -m)" | |
| if [ "$ARCH" = "x86_64" ]; then ARCH="amd64"; elif [ "$ARCH" = "aarch64" ]; then ARCH="arm64"; fi | |
| OS="$(uname -s | tr '[:upper:]' '[:lower:]')" | |
| URL="https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_${OS}_${ARCH}.tar.gz" | |
| curl -L "$URL" | tar xz mcp-publisher | |
| mkdir -p "$HOME/.local/bin" | |
| install -m 0755 mcp-publisher "$HOME/.local/bin/mcp-publisher" | |
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | |
| - name: Publish to MCP Registry | |
| env: | |
| MCP_REGISTRY_URL: https://registry.modelcontextprotocol.io | |
| run: | | |
| # Fail early if the file is missing | |
| test -f server.json | |
| # Publish. The CLI defaults may evolve; these flags keep it explicit. | |
| # If the CLI prefers envs, it will read MCP_REGISTRY_URL. | |
| mcp-publisher publish \ | |
| --mcp-file server.json \ | |
| --registry-url "$MCP_REGISTRY_URL" |