11#! /usr/bin/env bash
22# Update Smithery registry metadata for mtg-mcp-server.
3+ # Reads description from pyproject.toml (single source of truth).
34# Requires SMITHERY_API_KEY env var (get via: npx @smithery/cli auth token)
45set -euo pipefail
56: " ${SMITHERY_API_KEY:? Set SMITHERY_API_KEY (run: npx @ smithery/ cli auth token)} "
67SERVER=" j4th/mtg-mcp-server"
78API=" https://api.smithery.ai/servers/${SERVER} "
89
10+ # Build JSON payload from pyproject.toml (single source of truth for PyPI, MCP Registry, Smithery)
11+ PAYLOAD=$( python3 -c "
12+ import json, tomllib
13+ proj = tomllib.load(open('pyproject.toml', 'rb'))['project']
14+ print(json.dumps({
15+ 'displayName': 'MTG MCP Server',
16+ 'description': proj['description'],
17+ 'homepage': proj['urls']['Homepage'],
18+ }))
19+ " )
20+
921echo " Updating metadata for ${SERVER} ..."
22+ echo " Payload: ${PAYLOAD} "
1023
1124# PATCH display name, description, homepage
1225HTTP_CODE=$( curl -sS -o /tmp/smithery_resp.json -w " %{http_code}" -X PATCH " $API " \
1326 -H " Authorization: Bearer $SMITHERY_API_KEY " \
1427 -H " Content-Type: application/json" \
15- -d ' {
16- "displayName": "MTG MCP Server",
17- "description": "Magic: The Gathering data for AI — cards, combos, draft analytics, and Commander tools.",
18- "homepage": "https://github.com/j4th/mtg-mcp-server"
19- }' )
28+ -d " $PAYLOAD " )
2029if [[ " $HTTP_CODE " != 2* ]]; then
2130 echo " ERROR: PATCH metadata failed with HTTP $HTTP_CODE :" >&2
2231 cat /tmp/smithery_resp.json >&2
@@ -29,8 +38,7 @@ echo " ✓ Metadata updated"
2938[[ -f icon.svg ]] || { echo " ERROR: icon.svg not found in $( pwd) " >&2 ; exit 1; }
3039HTTP_CODE=$( curl -sS -o /tmp/smithery_resp.json -w " %{http_code}" -X PUT " $API /icon" \
3140 -H " Authorization: Bearer $SMITHERY_API_KEY " \
32- -H " Content-Type: image/svg+xml" \
33- --data-binary @icon.svg)
41+ -F " icon=@icon.svg;type=image/svg+xml" )
3442if [[ " $HTTP_CODE " != 2* ]]; then
3543 echo " ERROR: PUT icon failed with HTTP $HTTP_CODE :" >&2
3644 cat /tmp/smithery_resp.json >&2
0 commit comments