diff --git a/.github/workflows/mcp-registry.yml b/.github/workflows/mcp-registry.yml new file mode 100644 index 0000000..de7f112 --- /dev/null +++ b/.github/workflows/mcp-registry.yml @@ -0,0 +1,72 @@ +name: MCP Registry + +# Valida server.json en cada PR y publica en el registro oficial de MCP +# (io.github.acertijosapps/android-viewer) al crear un Release de GitHub, después de +# `npm publish`: el registro comprueba que el paquete de npm ya trae `mcpName`. + +on: + pull_request: + branches: [beta, main] + release: + types: [published] + workflow_dispatch: + +concurrency: + group: mcp-registry-${{ github.ref }} + cancel-in-progress: false + +permissions: + contents: read + +env: + MCP_PUBLISHER_VERSION: v1.8.1 + +jobs: + registry: + name: Validar y publicar en el registro de MCP + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write # OIDC: el namespace io.github.acertijosapps sale del repo + steps: + - uses: actions/checkout@v5 + + # package.json es la fuente de la versión; server.json la toma de ahí. + - name: Sincronizar la versión de server.json + run: | + VERSION=$(jq -r .version package.json) + jq --arg v "$VERSION" '.version = $v | .packages[0].version = $v' server.json > server.tmp + mv server.tmp server.json + jq '{name, version, package: .packages[0].version}' server.json + + - name: Instalar cosign + uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2 + + - name: Descargar y verificar mcp-publisher + run: | + set -euo pipefail + os="$(uname -s | tr '[:upper:]' '[:lower:]')" + arch="$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" + archive="mcp-publisher_${os}_${arch}.tar.gz" + base_url="https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}" + + curl --fail --location --silent --show-error --output "$archive" "$base_url/$archive" + curl --fail --location --silent --show-error --output "$archive.sigstore.json" "$base_url/$archive.sigstore.json" + cosign verify-blob \ + --bundle "$archive.sigstore.json" \ + --certificate-identity "https://github.com/modelcontextprotocol/registry/.github/workflows/release.yml@refs/tags/${MCP_PUBLISHER_VERSION}" \ + --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \ + "$archive" + tar xzf "$archive" mcp-publisher + rm -f "$archive" "$archive.sigstore.json" + + - name: Validar server.json + run: ./mcp-publisher validate server.json + + - name: Autenticar con el registro (OIDC) + if: github.event_name != 'pull_request' + run: ./mcp-publisher login github-oidc + + - name: Publicar en el registro + if: github.event_name != 'pull_request' + run: ./mcp-publisher publish diff --git a/CHANGELOG.md b/CHANGELOG.md index ad70397..3aff199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Formato basado en [Keep a Changelog](https://keepachangelog.com/es-ES/); version ## [Sin liberar] ### Añadido +- Registro oficial de MCP como `io.github.acertijosapps/android-viewer`: `mcpName` en `package.json`, `server.json` (arranca con `npx @acertijosapps/android-viewer mcp`) y workflow que valida `server.json` en cada PR y lo publica por OIDC al crear un Release de GitHub. ### Cambiado diff --git a/README.md b/README.md index f2b26bf..a50f662 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,9 @@ Any other MCP client: } ``` +Also listed in the [official MCP Registry](https://registry.modelcontextprotocol.io) as +`io.github.acertijosapps/android-viewer`. + Keep the viewer running (`npx @acertijosapps/android-viewer`) to watch what the agent does. Without it, the MCP drives the device through `adb` directly. diff --git a/package.json b/package.json index 6513ffe..901dd7e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "@acertijosapps/android-viewer", + "mcpName": "io.github.acertijosapps/android-viewer", "version": "1.0.0", "description": "Visor web del emulador de Android (screenrecord H.264 + WebCodecs, input por adb, posturas de plegable) y MCP para que un agente lo maneje.", "type": "module", diff --git a/server.json b/server.json new file mode 100644 index 0000000..8fd46c4 --- /dev/null +++ b/server.json @@ -0,0 +1,43 @@ +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json", + "name": "io.github.acertijosapps/android-viewer", + "title": "Android Viewer", + "description": "Drive Android emulators: screenshots, taps, swipes, keys, text, rotation and foldable postures.", + "repository": { + "url": "https://github.com/acertijosapps/android-viewer", + "source": "github" + }, + "websiteUrl": "https://github.com/acertijosapps/android-viewer#readme", + "version": "1.0.0", + "packages": [ + { + "registryType": "npm", + "identifier": "@acertijosapps/android-viewer", + "version": "1.0.0", + "runtimeHint": "npx", + "transport": { + "type": "stdio" + }, + "packageArguments": [ + { + "type": "positional", + "value": "mcp" + } + ], + "environmentVariables": [ + { + "name": "ANDROID_VIEWER_URL", + "description": "Viewer to show actions live (default http://localhost:8093); without it, adb is used directly", + "isRequired": false, + "format": "string" + }, + { + "name": "ANDROID_HOME", + "description": "Android SDK location, if adb and emulator are not found automatically", + "isRequired": false, + "format": "string" + } + ] + } + ] +}