-
-
Notifications
You must be signed in to change notification settings - Fork 6
62 lines (51 loc) · 2.51 KB
/
Copy pathmcp-publish.yml
File metadata and controls
62 lines (51 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Publish to MCP Registry
env:
UV_MALWARE_CHECK: '1' # abort any uv resolution that hits an OSV malicious-package record
# Publishes server.json to the official MCP registry once the PyPI package for the
# tag is available. Authenticates with GitHub OIDC (no stored secrets); the registry
# verifies ownership via the io.github.astrogilda/* namespace and the mcp-name marker
# in the package README. The PyPI release itself is handled by release.yml.
permissions: {}
# Serialize publishes; never cancel one mid-flight.
concurrency:
group: mcp-publish
on:
release:
types: [published]
workflow_dispatch: # manual re-publish (e.g. after a transient registry or PyPI-timing failure)
jobs:
publish-mcp:
name: Publish server.json to the MCP registry
runs-on: ubuntu-latest
permissions:
id-token: write # the registry authenticates this workflow via GitHub OIDC
contents: read # checkout of server.json and the version stamp
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install mcp-publisher
run: |
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
- name: Wait for the PyPI release to be available
# The PyPI publish (release.yml) and this workflow both trigger on the
# release event and run in parallel. The registry validates that the
# version in server.json exists on PyPI, so this must wait for the new
# version to appear or it fails with a 404. Poll for up to 20 minutes.
run: |
version="$(python3 -c "import json; print(json.load(open('server.json'))['version'])")"
echo "Waiting for tsbootstrap ${version} on PyPI..."
for attempt in $(seq 1 80); do
if curl -sfL "https://pypi.org/pypi/tsbootstrap/${version}/json" >/dev/null; then
echo "tsbootstrap ${version} is available on PyPI."
exit 0
fi
echo " attempt ${attempt}/80: not on PyPI yet, sleeping 15s..."
sleep 15
done
echo "Timed out waiting for tsbootstrap ${version} on PyPI." >&2
exit 1
- name: Authenticate to the MCP registry
run: ./mcp-publisher login github-oidc
- name: Publish server to the MCP registry
run: ./mcp-publisher publish