Skip to content

Commit 8840323

Browse files
authored
fix: resolve MCP registry publish race condition by merging into publish workflow (#21)
The MCP registry publish workflow (publish-mcp-registry.yml) ran concurrently with the PyPI publish workflow on release events. The MCP Registry validates that the PyPI package exists before accepting the server.json, but due to the race condition it got a 404. Fix by merging the MCP registry publishing as a dependent job (needs: publish) into publish.yml, ensuring PyPI upload completes before the MCP Registry validation runs. Removed the standalone publish-mcp-registry.yml to avoid duplicate triggers.
1 parent af15fe3 commit 8840323

2 files changed

Lines changed: 42 additions & 49 deletions

File tree

.github/workflows/publish-mcp-registry.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to PyPI
1+
name: Publish to PyPI and MCP Registry
22

33
on:
44
release:
@@ -72,3 +72,44 @@ jobs:
7272

7373
- name: Publish to PyPI
7474
uses: pypa/gh-action-pypi-publish@release/v1
75+
76+
publish-mcp-registry:
77+
name: Publish server.json to MCP Registry
78+
needs: publish
79+
runs-on: ubuntu-24.04
80+
permissions:
81+
contents: read
82+
id-token: write # Required for OIDC authentication with MCP Registry
83+
steps:
84+
- name: Checkout repo
85+
uses: actions/checkout@v7
86+
87+
- name: Extract version from release tag
88+
id: version
89+
run: |
90+
TAG="${{ github.event.release.tag_name }}"
91+
if [ -z "$TAG" ]; then
92+
TAG="$(git describe --tags --abbrev=0)"
93+
fi
94+
VERSION="${TAG#v}"
95+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
96+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
97+
98+
- name: Set version in server.json
99+
run: |
100+
VERSION="${{ steps.version.outputs.version }}"
101+
echo "Setting server.json version to $VERSION"
102+
jq --arg v "$VERSION" '.version = $v | .packages[0].version = $v' server.json > server.json.tmp
103+
mv server.json.tmp server.json
104+
echo "=== Updated server.json ==="
105+
cat server.json
106+
107+
- name: Install mcp-publisher
108+
run: |
109+
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
110+
111+
- name: Authenticate to MCP Registry (OIDC)
112+
run: ./mcp-publisher login github-oidc
113+
114+
- name: Publish server to MCP Registry
115+
run: ./mcp-publisher publish

0 commit comments

Comments
 (0)