-
Notifications
You must be signed in to change notification settings - Fork 197
59 lines (49 loc) · 2.26 KB
/
Copy pathpublish-mcp.yml
File metadata and controls
59 lines (49 loc) · 2.26 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
name: Publish to MCP Registry
# Publishes server.json to the official MCP Registry (registry.modelcontextprotocol.io),
# which the GitHub MCP Registry (github.com/mcp) syncs from.
#
# Run this AFTER the PyPI package and GHCR image for the release exist — the registry
# validates both artifacts at publish time:
# 1. Tag + GitHub release -> Docker image published to GHCR (release-docker.yml)
# 2. Run "publish" workflow -> package published to PyPI (publish.yml)
# 3. Run this workflow -> server published to the MCP Registry
on:
workflow_dispatch:
inputs:
ref:
description: "Tag to publish (e.g. v0.4.1)"
required: true
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC authentication to the MCP Registry
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Set version in server.json from pyproject.toml
run: |
VERSION=$(grep -m1 '^version' pyproject.toml | sed 's/.*"\(.*\)"/\1/')
echo "Publishing version $VERSION"
jq --arg v "$VERSION" '
.version = $v
| .packages |= map(
if .registryType == "pypi" then .version = $v
elif .registryType == "oci" then .identifier = (.identifier | sub(":[^:]*$"; ":" + $v))
else . end)
' server.json > server.json.tmp && mv server.json.tmp server.json
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Verify PyPI package exists
run: curl -fsS "https://pypi.org/pypi/mcp-clickhouse/${VERSION}/json" > /dev/null
- name: Verify GHCR image exists
run: docker manifest inspect "ghcr.io/clickhouse/mcp-clickhouse:${VERSION}" > /dev/null
- 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: Authenticate to MCP Registry
run: ./mcp-publisher login github-oidc
- name: Publish server to MCP Registry
run: ./mcp-publisher publish