Correctly split MCP registry update to it’s own workflow. (#21089)
* Correctly split MCP registry update to it’s own workflow. This needs to trigger when your releases are actually published, not when we start the release process, so it needs to have it’s own workflow with a release trigger instead of being part of the release workflow (as we always manually publish the release on GitHub). This actually simplifies a couple of parts of the job as well, since the `release` event defaults to using the commit of the release that triggered the workflow when checking out the repository. * Address review comments.
Austin S. Hemmelgarn committed
Oct 3, 2025 at 06:56 UTC
81acfc85b582c1fd78ade45f37fb60902514457c
2 files changed
+64
-60
.github/workflows/release.yml
-60
@@ -250,63 +250,3 @@ jobs:
250
Trigger build: ${{ steps.trigger.outcome }}
251
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
252
if: failure()
253
-
254
- publish-mcp-registry:
255
- name: Publish to MCP Registry
256
- runs-on: ubuntu-latest
257
- needs: update-changelogs
258
- if: needs.update-changelogs.outputs.run == 'true' && needs.update-changelogs.outputs.type != 'nightly'
259
- steps:
260
- - name: Checkout
261
- id: checkout
262
- uses: actions/checkout@v5
263
- with:
264
- ref: ${{ needs.update-changelogs.outputs.ref }}
265
- - name: Update server.json version
266
- id: update-version
267
- run: |
268
- VERSION="${{ needs.update-changelogs.outputs.version }}"
269
- # Remove 'v' prefix if present
270
- VERSION="${VERSION#v}"
271
- # Update version in server.json
272
- sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" server.json
273
- echo "Updated server.json to version: $VERSION"
274
- - name: Install mcp-publisher
275
- id: install
276
- run: |
277
- # Clone and build mcp-publisher
278
- git clone https://github.com/modelcontextprotocol/registry.git /tmp/registry
279
- cd /tmp/registry
280
- make publisher
281
- sudo cp bin/mcp-publisher /usr/local/bin/
282
- mcp-publisher --version
283
- - name: Authenticate with GitHub
284
- id: auth
285
- run: |
286
- # GitHub Actions automatically provides GITHUB_TOKEN with OIDC
287
- # mcp-publisher will use this for authentication
288
- echo "Using GitHub OIDC authentication"
289
- - name: Publish to registry
290
- id: publish
291
- env:
292
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
293
- run: |
294
- cd ${{ github.workspace }}
295
- mcp-publisher publish server.json
296
- - name: Failure Notification
297
- uses: rtCamp/action-slack-notify@v2
298
- env:
299
- SLACK_COLOR: 'danger'
300
- SLACK_FOOTER: ''
301
- SLACK_ICON_EMOJI: ':github-actions:'
302
- SLACK_TITLE: 'Failed to publish to MCP Registry:'
303
- SLACK_USERNAME: 'GitHub Actions'
304
- SLACK_MESSAGE: |-
305
- ${{ github.repository }}: Failed to publish ${{ needs.update-changelogs.outputs.version }} to MCP Registry.
306
- Checkout: ${{ steps.checkout.outcome }}
307
- Update version: ${{ steps.update-version.outcome }}
308
- Install mcp-publisher: ${{ steps.install.outcome }}
309
- Authenticate: ${{ steps.auth.outcome }}
310
- Publish: ${{ steps.publish.outcome }}
311
- SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
312
- if: failure()
.github/workflows/update-mcp-registry.yml
new
+64
@@ -0,0 +1,64 @@
1
+---
2
+name: Update MCP Registry
3
+on:
4
+ release:
5
+ types: [released]
6
+concurrency:
7
+ group: update-mcp-registry-${{ github.ref }}-${{ github.event_name }}
8
+ cancel-in-progress: true
9
+jobs:
10
+ publish-mcp-registry:
11
+ name: Publish to MCP Registry
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Checkout
15
+ id: checkout
16
+ uses: actions/checkout@v5
17
+ - name: Update server.json version
18
+ id: update-version
19
+ run: |
20
+ VERSION="$(cat packaging/version)"
21
+ # Remove 'v' prefix if present
22
+ VERSION="${VERSION#v}"
23
+ # Update version in server.json
24
+ sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" server.json
25
+ echo "Updated server.json to version: $VERSION"
26
+ - name: Install mcp-publisher
27
+ id: install
28
+ run: |
29
+ # Clone and build mcp-publisher
30
+ git clone https://github.com/modelcontextprotocol/registry.git /tmp/registry
31
+ cd /tmp/registry
32
+ make publisher
33
+ sudo cp bin/mcp-publisher /usr/local/bin/
34
+ mcp-publisher --version
35
+ - name: Authenticate with GitHub
36
+ id: auth
37
+ run: |
38
+ # GitHub Actions automatically provides GITHUB_TOKEN with OIDC
39
+ # mcp-publisher will use this for authentication
40
+ echo "Using GitHub OIDC authentication"
41
+ - name: Publish to registry
42
+ id: publish
43
+ env:
44
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45
+ run: |
46
+ cd ${{ github.workspace }}
47
+ mcp-publisher publish server.json
48
+ - name: Failure Notification
49
+ uses: rtCamp/action-slack-notify@v2
50
+ env:
51
+ SLACK_COLOR: 'danger'
52
+ SLACK_FOOTER: ''
53
+ SLACK_ICON_EMOJI: ':github-actions:'
54
+ SLACK_TITLE: 'Failed to publish to MCP Registry:'
55
+ SLACK_USERNAME: 'GitHub Actions'
56
+ SLACK_MESSAGE: |-
57
+ ${{ github.repository }}: Failed to publish new agent version to MCP Registry.
58
+ Checkout: ${{ steps.checkout.outcome }}
59
+ Update version: ${{ steps.update-version.outcome }}
60
+ Install mcp-publisher: ${{ steps.install.outcome }}
61
+ Authenticate: ${{ steps.auth.outcome }}
62
+ Publish: ${{ steps.publish.outcome }}
63
+ SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
64
+ if: failure()