-
Notifications
You must be signed in to change notification settings - Fork 1
ci: publish server.json to the Official MCP Registry from GitHub Actions #7
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
okwasniewski
merged 1 commit into
tester-army:main
from
lil-bsz:ci/publish-mcp-registry
Sep 21, 2026
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,99 @@ | ||
| name: Publish to MCP Registry | ||
|
|
||
| # Publishes server.json to the Official MCP Registry (registry.modelcontextprotocol.io) as | ||
| # io.github.tester-army/testerarmy, which feeds Glama, PulseMCP and the other aggregators. | ||
| # | ||
| # Authentication is GitHub Actions OIDC: the registry grants the io.github.<repository owner>/* | ||
| # namespace to workflows running in this organisation's repositories. A personal | ||
| # `mcp-publisher login github` only gets that namespace for org Owners (plain members are refused), | ||
| # so this workflow is the route that needs nobody's personal login and no stored secret. | ||
| # | ||
| # Runs when server.json (or this file) lands on main, and on demand from the Actions tab. Manual | ||
| # runs are limited to main because the registry authorises on the repository owner alone and never | ||
| # looks at the branch: without the guard, any writer could publish an unreviewed branch under the | ||
| # org name. The `mcp-registry-publish` environment exists so an org Owner can add a deployment | ||
| # branch rule and a required reviewer in Settings > Environments without touching this file; until | ||
| # then the `if:` below is the gate. | ||
| # | ||
| # The registry refuses a version it already has, so the job first checks whether server.json's | ||
| # version is published and skips cleanly if so. To publish again, bump "version" in server.json | ||
| # together with the plugin manifests; scripts/check-plugin-manifests.sh fails if they differ. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "server.json" | ||
| - ".github/workflows/publish-mcp-registry.yml" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| publish: | ||
| if: github.ref == 'refs/heads/main' | ||
| runs-on: ubuntu-latest | ||
| environment: mcp-registry-publish | ||
| # One publish at a time; a parallel run for the same version would only fail. | ||
| concurrency: publish-mcp-registry | ||
| permissions: | ||
| id-token: write # OIDC token exchanged with the registry | ||
| contents: read | ||
| env: | ||
| # If "login github-oidc" fails with "invalid audience", the registry moved ahead of this | ||
| # binary: bump to the latest release at https://github.com/modelcontextprotocol/registry/releases | ||
| MCP_PUBLISHER_VERSION: "1.8.1" | ||
| REGISTRY_URL: https://registry.modelcontextprotocol.io | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Install mcp-publisher (download checksum verified) | ||
| run: | | ||
| base="https://github.com/modelcontextprotocol/registry/releases/download/v${MCP_PUBLISHER_VERSION}" | ||
| curl -fsSL --retry 3 "$base/mcp-publisher_linux_amd64.tar.gz" -o mcp-publisher_linux_amd64.tar.gz | ||
| curl -fsSL --retry 3 "$base/registry_${MCP_PUBLISHER_VERSION}_checksums.txt" -o checksums.txt | ||
| sha256sum --check --ignore-missing checksums.txt | ||
| tar xzf mcp-publisher_linux_amd64.tar.gz mcp-publisher | ||
| ./mcp-publisher --version | ||
|
|
||
| # The registry's own validator: schema plus the semantic rules the publish endpoint applies. | ||
| - name: Validate server.json against the registry | ||
| run: ./mcp-publisher validate server.json | ||
|
|
||
| - name: Skip if this version is already published | ||
| id: check | ||
| run: | | ||
| name=$(jq -r .name server.json) | ||
| version=$(jq -r .version server.json) | ||
| encoded=$(jq -rn --arg n "$name" '$n | @uri') | ||
| if curl -fsS -o /dev/null "$REGISTRY_URL/v0/servers/$encoded/versions/$version"; then | ||
| echo "::notice::$name@$version is already in the registry; bump version in server.json to publish again" | ||
| echo "skip=true" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Log in with GitHub Actions OIDC | ||
| if: steps.check.outputs.skip != 'true' | ||
| run: ./mcp-publisher login github-oidc | ||
|
|
||
| - name: Publish | ||
| if: steps.check.outputs.skip != 'true' | ||
| run: ./mcp-publisher publish server.json | ||
|
|
||
| # Exact lookup: 404 (and a failed step) if the version is not there. | ||
| - name: Confirm the registry entry | ||
| run: | | ||
| set -euo pipefail | ||
| name=$(jq -r .name server.json) | ||
| version=$(jq -r .version server.json) | ||
| encoded=$(jq -rn --arg n "$name" '$n | @uri') | ||
| entry=$(curl -fsS --retry 3 "$REGISTRY_URL/v0/servers/$encoded/versions/$version" \ | ||
| | jq '{name: .server.name, version: .server.version, status: ._meta["io.modelcontextprotocol.registry/official"].status, isLatest: ._meta["io.modelcontextprotocol.registry/official"].isLatest, publishedAt: ._meta["io.modelcontextprotocol.registry/official"].publishedAt}') | ||
| echo "$entry" | ||
| { | ||
| echo "### MCP Registry: $name@$version" | ||
| echo '```json' | ||
| echo "$entry" | ||
| echo '```' | ||
| echo "Glama connector page (claim it once it appears): https://glama.ai/mcp/connectors/$name" | ||
| } >> "$GITHUB_STEP_SUMMARY" | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "$schema": "https://glama.ai/mcp/schemas/server.json", | ||
| "maintainers": ["okwasniewski", "szymonrybczak", "lil-bsz"] | ||
| } |
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
Oops, something went wrong.
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.
P2: When the registry lookup gets a transient 5xx, rate limit, or network error, this conditional treats the version as unpublished and runs the publish path. Distinguish HTTP 404 from lookup errors and retry or fail before publishing.
Prompt for AI agents