Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to PyPI
name: Publish to PyPI and the MCP Registry

on:
release:
Expand Down Expand Up @@ -26,3 +26,47 @@ jobs:

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

# The MCP Registry checks the package on PyPI (the README's mcp-name marker,
# the pinned version), so this runs only once the upload above succeeded.
mcp-registry:
needs: publish
runs-on: ubuntu-latest
permissions:
id-token: write # mcp-publisher logs in with the workflow's OIDC token
contents: read
steps:
- uses: actions/checkout@v4

- name: Check the release matches server.json
run: |
listed=$(jq -r .version server.json)
if [ "v$listed" != "$GITHUB_REF_NAME" ]; then
echo "::error::release $GITHUB_REF_NAME but server.json lists $listed"
exit 1
fi
echo "VERSION=$listed" >> "$GITHUB_ENV"

- name: Wait for PyPI to serve the release
run: |
# PyPI's JSON API can lag the upload by a few minutes.
for _ in $(seq 1 30); do
if curl -fsS "https://pypi.org/pypi/pymemoryeditor/$VERSION/json" \
| jq -e --arg name "$(jq -r .name server.json)" \
'.info.description | contains("mcp-name: " + $name)' > /dev/null; then
exit 0
fi
sleep 20
done
echo "::error::PyPI does not serve $VERSION with the mcp-name marker yet"
exit 1

- name: Install mcp-publisher
run: |
curl -fsSL "https://github.com/modelcontextprotocol/registry/releases/download/v1.8.1/mcp-publisher_linux_amd64.tar.gz" \
| tar xz mcp-publisher

- name: Publish to the MCP Registry
run: |
./mcp-publisher login github-oidc
./mcp-publisher publish
Loading