Repository navigation
feat(ci): publish to the Official MCP Registry on release, via OIDC #829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| name: MCP Registry | ||
|
|
||
| # Publishes server.json to the Official MCP Registry — the listing that feeds the | ||
| # downstream directories (PulseMCP ingests it; GitHub's MCP gallery is built on it). | ||
| # | ||
| # Ordering matters and is why this hangs off `release: published` rather than the | ||
| # tag push. `mcp-publisher` proves namespace ownership by reading the `mcp-name:` | ||
| # token out of the PUBLISHED PyPI README, and PyPI metadata is frozen per release — | ||
| # so the wheel has to be up first. `release.yml` publishes to PyPI and only then | ||
| # creates the GitHub Release, so by the time this fires the token is live. | ||
| # | ||
| # Auth is GitHub Actions OIDC. There is no PAT and no device-code flow: the runner | ||
| # exchanges its own short-lived identity token for registry credentials, which is | ||
| # why this needs `id-token: write` and nothing else. | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| # Manual re-run, e.g. a release whose registry publish failed after PyPI | ||
| # succeeded. `validate` runs first either way, so a bad server.json stops | ||
| # before anything is sent. | ||
| workflow_dispatch: | ||
|
|
||
| # Write scopes live at JOB level (Scorecard Token-Permissions: a workflow-level | ||
| # write grant reaches every job, current and future). | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write # OIDC exchange with registry.modelcontextprotocol.io | ||
| env: | ||
| # Pinned by version AND digest: this step runs in a job holding id-token | ||
| # write and publishes publicly under io.github.ffroliva, so a moved tag | ||
| # must not silently change the binary that does it. | ||
| MCP_PUBLISHER_VERSION: "1.8.1" | ||
| MCP_PUBLISHER_SHA256: "a06c9096dcb9727c13555b6be26c7effa707b01f06a4c561ba7a3635443cf2cc" | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Install mcp-publisher | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| set -euo pipefail | ||
| archive="${RUNNER_TEMP}/mcp-publisher_linux_amd64.tar.gz" | ||
| gh release download "v${MCP_PUBLISHER_VERSION}" \ | ||
| --repo modelcontextprotocol/registry \ | ||
| --pattern 'mcp-publisher_linux_amd64.tar.gz' \ | ||
| --output "${archive}" --clobber | ||
| echo "${MCP_PUBLISHER_SHA256} ${archive}" | sha256sum -c - | ||
| tar -xzf "${archive}" -C "${RUNNER_TEMP}" mcp-publisher | ||
| "${RUNNER_TEMP}/mcp-publisher" --version | ||
| echo "${RUNNER_TEMP}" >> "${GITHUB_PATH}" | ||
|
|
||
| - name: Validate server.json | ||
| # Never `init` here: it only writes a TEMPLATE server.json, refuses when a | ||
| # real one exists, and exits 1 — which would abort the run before login. | ||
| run: mcp-publisher validate | ||
|
|
||
| - name: Authenticate with the registry (GitHub Actions OIDC) | ||
| run: mcp-publisher login github-oidc | ||
|
|
||
| - name: Publish | ||
| run: mcp-publisher publish | ||
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Ensure normal releases trigger registry publication. The tag-triggered
.github/workflows/release.ymlcreates the GitHub Release withsoftprops/action-gh-releaseand notokeninput, so the action usesgithub.token(GITHUB_TOKEN). GitHub does not start workflows forreleaseevents created with that token. Therefore,.github/workflows/mcp-registry.ymlwill not run automatically after normal releases;workflow_dispatchremains only a manual fallback. Use a PAT or GitHub App token for release creation, or invoke the registry publisher from the release workflow.🤖 Prompt for AI Agents