@@ -138,78 +138,44 @@ jobs:
138138 continue-on-error : true
139139 steps :
140140 - uses : actions/checkout@v5
141- - name : Install MCP Publisher CLI
142- run : |
143- 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" | tar xz mcp-publisher
144141 - name : Extract version from tag
145142 id : ver
146143 run : |
147144 echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
148- - name : Generate server.json
149- id : server
145+ - name : Extract project metadata
146+ id : metadata
150147 env :
151148 VERSION : ${{ steps.ver.outputs.VERSION }}
152149 run : |
153150 python - <<'PY'
154- import json, tomllib, os
151+ import tomllib, os
155152 VERSION = os.environ['VERSION']
156153 with open('pyproject.toml','rb') as f:
157154 data = tomllib.load(f)
158155 project = data['project']
159- server = {
160- "name": f"io.github.OtherVibes/{project['name']}",
161- "description": project['description'],
162- "version": VERSION,
163- "homepage": next((url[1] for url in project.get('urls', {}).items() if url[0] == 'Homepage'), ''),
164- "license": project.get('license', {}).get('text', 'MIT'),
165- "runtime": {
166- "type": "uv",
167- "package": f"{project['name']}=={VERSION}",
168- "transport": {"type": "stdio"}
169- }
170- }
171- with open('server.json', 'w') as f:
172- json.dump(server, f, indent=2)
156+
157+ # Extract metadata for the action
158+ name = f"io.github.OtherVibes/{project['name']}"
159+ description = project['description']
160+ homepage = next((url[1] for url in project.get('urls', {}).items() if url[0] == 'Homepage'), '')
161+ package_name = project['name']
162+
163+ # Write to GitHub outputs
173164 with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
174- f.write(f"json={json.dumps(server)}\n")
165+ f.write(f"name={name}\n")
166+ f.write(f"description={description}\n")
167+ f.write(f"homepage={homepage}\n")
168+ f.write(f"package_name={package_name}\n")
175169 PY
176- - name : Login to MCP Registry (GitHub OIDC)
177- run : |
178- ./mcp-publisher login github-oidc
179170 - name : Publish to MCP Registry
180- env :
181- NAME : ${{ fromJSON(steps.server.outputs.json).name }}
182- run : |
183- ./mcp-publisher publish server.json
184- - name : Verify publication
185- env :
186- NAME : ${{ fromJSON(steps.server.outputs.json).name }}
187- VERSION : ${{ fromJSON(steps.server.outputs.json).version }}
188- run : |
189- echo "✅ Publication command completed successfully"
190- echo "📋 Published server: $NAME version $VERSION"
191-
192- echo "🔍 Verifying publication in registry..."
193-
194- # Use search parameter to find our server (includes all versions)
195- server_name_only=$(echo "$NAME" | sed 's/.*\///')
196- curl -s "https://registry.modelcontextprotocol.io/v0/servers?search=$server_name_only" > search_results.json
197-
198- # Check if our specific version exists
199- version_found=$(jq -r --arg name "$NAME" --arg version "$VERSION" '.servers[] | select(.name == $name and .version == $version) | .version' search_results.json)
200-
201- if [ -n "$version_found" ]; then
202- echo "✅ Server $NAME version $VERSION is published in MCP Registry!"
203- echo "📋 Server details:"
204- jq -r --arg name "$NAME" --arg version "$VERSION" '.servers[] | select(.name == $name and .version == $version) | {name, version, description, is_latest: ._meta."io.modelcontextprotocol.registry/official".is_latest}' search_results.json
205-
206- # Show all versions of this server
207- echo ""
208- echo "� All published versions:"
209- jq -r --arg name "$NAME" '.servers[] | select(.name == $name) | " - v" + .version + " (latest: " + (._meta."io.modelcontextprotocol.registry/official".is_latest | tostring) + ")"' search_results.json | sort -V
210- else
211- echo "❌ Server $NAME version $VERSION not found in registry"
212- echo "🔍 Available versions for this server:"
213- jq -r --arg name "$NAME" '.servers[] | select(.name == $name) | " - v" + .version' search_results.json | sort -V
214- exit 1
215- fi
171+ uses : OtherVibes/mcp-publish-action@v1
172+ with :
173+ name : ${{ steps.metadata.outputs.name }}
174+ description : ${{ steps.metadata.outputs.description }}
175+ version : ${{ steps.ver.outputs.VERSION }}
176+ website_url : ${{ steps.metadata.outputs.homepage }}
177+ registry_type : pypi
178+ identifier : ${{ steps.metadata.outputs.package_name }}
179+ package_version : ${{ steps.ver.outputs.VERSION }}
180+ transport_type : stdio
181+ verify : true
0 commit comments