@@ -3,20 +3,21 @@ name: Update MCP registry
33on :
44 pull_request :
55 paths :
6- - " netlify/mcp.js"
6+ - " netlify/edge-functions/mcp.js"
7+ - " server.json"
78 push :
89 branches : [ main ]
910 paths :
1011 - " server.json"
11- - " netlify/mcp.js"
12+ - " netlify/edge-functions/ mcp.js"
1213 workflow_dispatch :
1314
1415permissions :
1516 contents : write
1617 id-token : write
1718
1819jobs :
19- bump_version_on_pr :
20+ validate_and_bump_version_on_pr :
2021 if : github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
2122 runs-on : ubuntu-latest
2223 steps :
@@ -32,14 +33,47 @@ jobs:
3233 with :
3334 node-version : " lts/*"
3435
36+ - name : Validate server.json
37+ run : |
38+ echo "Validating server.json..."
39+ if [ ! -f server.json ]; then
40+ echo "Error: server.json not found!"
41+ exit 1
42+ fi
43+
44+ if ! jq empty server.json 2>/dev/null; then
45+ echo "Error: server.json is not valid JSON!"
46+ exit 1
47+ fi
48+
49+ echo "server.json is valid"
50+
3551 - name : Compute new version and update server.json
3652 run : |
3753 VERSION="$(date -u +%Y.%m.%d)+pr${{ github.event.number }}-${GITHUB_SHA::7}"
3854 echo "New version: $VERSION"
55+ echo "VERSION=$VERSION" >> $GITHUB_ENV
56+
3957 jq --arg v "$VERSION" '.version = $v' server.json > server.tmp.json
4058 mv server.tmp.json server.json
4159 git diff -- server.json || true
4260
61+ - name : Install MCP Publisher for validation
62+ run : |
63+ echo "Downloading MCP Publisher..."
64+ ARCH="$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')"
65+ DOWNLOAD_URL="https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_${ARCH}.tar.gz"
66+
67+ if ! curl -fsSL "$DOWNLOAD_URL" | tar xz mcp-publisher; then
68+ echo "Error: Failed to download or extract mcp-publisher"
69+ echo "Attempted URL: $DOWNLOAD_URL"
70+ exit 1
71+ fi
72+
73+ chmod +x mcp-publisher
74+ ./mcp-publisher --version
75+ echo "MCP Publisher installed successfully"
76+
4377 - name : Commit and push version bump (if changed)
4478 run : |
4579 if ! git diff --quiet -- server.json; then
4882 git add server.json
4983 git commit -m "chore: bump server.json version to ${VERSION} (PR #${{ github.event.number }})"
5084 git push
85+ echo "Version bumped and committed"
5186 else
5287 echo "No changes to server.json; skipping commit."
5388 fi
@@ -59,19 +94,82 @@ jobs:
5994 - name : Checkout
6095 uses : actions/checkout@v4
6196
97+ - name : Setup Node (for jq availability)
98+ uses : actions/setup-node@v4
99+ with :
100+ node-version : " lts/*"
101+
102+ - name : Validate server.json
103+ run : |
104+ echo "Validating server.json..."
105+ if [ ! -f server.json ]; then
106+ echo "Error: server.json not found!"
107+ exit 1
108+ fi
109+
110+ if ! jq empty server.json 2>/dev/null; then
111+ echo "Error: server.json is not valid JSON!"
112+ exit 1
113+ fi
114+
115+ # Validate required fields
116+ if ! jq -e '.name and .version and .remotes' server.json > /dev/null; then
117+ echo "Error: server.json missing required fields"
118+ exit 1
119+ fi
120+
121+ VERSION=$(jq -r '.version' server.json)
122+ echo "Current version: $VERSION"
123+ echo "VERSION=$VERSION" >> $GITHUB_ENV
124+ echo "server.json is valid"
125+
62126 - name : Install MCP Publisher
63127 run : |
64- curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" \
65- | tar xz mcp-publisher
128+ echo "Downloading MCP Publisher..."
129+ ARCH="$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')"
130+ DOWNLOAD_URL="https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_${ARCH}.tar.gz"
131+
132+ if ! curl -fsSL "$DOWNLOAD_URL" | tar xz mcp-publisher; then
133+ echo "Error: Failed to download or extract mcp-publisher"
134+ echo "Attempted URL: $DOWNLOAD_URL"
135+ exit 1
136+ fi
137+
66138 chmod +x mcp-publisher
67139 ./mcp-publisher --version
140+ echo "MCP Publisher installed successfully"
68141
69- # DNS login using your Ed25519 private key (hex)
70142 - name : Log in to MCP Registry (DNS)
71- run : ./mcp-publisher login dns --domain redpanda.com --private-key "${{ secrets.MCP_REGISTRY_PRIVATE_KEY }}"
143+ run : |
144+ echo "Logging in to MCP Registry..."
145+ if [ -z "${{ secrets.MCP_REGISTRY_PRIVATE_KEY }}" ]; then
146+ echo "Error: MCP_REGISTRY_PRIVATE_KEY secret is not set"
147+ exit 1
148+ fi
149+
150+ ./mcp-publisher login dns --domain redpanda.com --private-key "${{ secrets.MCP_REGISTRY_PRIVATE_KEY }}"
151+ echo "Successfully logged in"
72152
73153 - name : Publish to MCP Registry
74- run : ./mcp-publisher publish
154+ run : |
155+ echo "Publishing to MCP Registry..."
156+ echo "Version: $VERSION"
157+
158+ if ./mcp-publisher publish; then
159+ echo "Successfully published to MCP Registry"
160+ else
161+ echo "Error: Failed to publish to MCP Registry"
162+ exit 1
163+ fi
164+
165+ - name : Verify publication
166+ run : |
167+ echo "Publication Summary:"
168+ echo " Server Name: $(jq -r '.name' server.json)"
169+ echo " Version: $VERSION"
170+ echo " Remote URL: $(jq -r '.remotes[0].url' server.json)"
171+ echo ""
172+ echo "MCP server successfully published!"
75173
76174 concurrency :
77175 group : mcp-publish-${{ github.ref }}
0 commit comments