diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b04cc59d..01232476 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -181,3 +181,42 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --draft=false --verify-tag + + publish-mcp: + name: Publish to MCP Registry + runs-on: ubuntu-latest + # Registry verification pulls the versioned Docker Hub image, so the tag must exist first + needs: docker-promote + # Best-effort: a registry outage must not fail the release + continue-on-error: true + permissions: + id-token: write # GitHub OIDC grants the io.github.enterpilot/* namespace + contents: read + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + persist-credentials: false + + - name: Install mcp-publisher + env: + PUBLISHER_VERSION: v1.8.0 + PUBLISHER_SHA256: 1370446bbe74d562608e8005a6ccce02d146a661fbd78674e11cc70b9618d6cf + run: | + curl -fsSL -o mcp-publisher.tar.gz "https://github.com/modelcontextprotocol/registry/releases/download/${PUBLISHER_VERSION}/mcp-publisher_linux_amd64.tar.gz" + echo "${PUBLISHER_SHA256} mcp-publisher.tar.gz" | sha256sum -c - + tar xzf mcp-publisher.tar.gz mcp-publisher + + - name: Set release version in server.json + shell: bash + run: | + version="${GITHUB_REF_NAME#v}" + jq --arg v "$version" \ + '.version = $v | .packages[0].identifier = "docker.io/enterpilot/gomodel:" + $v' \ + server.json > server.json.tmp && mv server.json.tmp server.json + + - name: Authenticate to MCP Registry + run: ./mcp-publisher login github-oidc + + - name: Publish server to MCP Registry + run: ./mcp-publisher publish diff --git a/Dockerfile b/Dockerfile index b621ae10..c0d6a3a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,9 @@ RUN mkdir -p /app/.cache /app/data && touch /app/.cache/.keep /app/data/.keep # Runtime stage FROM gcr.io/distroless/static-debian12:nonroot +# Ownership proof for the MCP Registry; must match the name in server.json +LABEL io.modelcontextprotocol.server.name="io.github.enterpilot/gomodel" + # Copy binary and runtime config COPY --from=builder /gomodel /gomodel COPY --from=builder /app/config/*.yaml /app/config/ diff --git a/server.json b/server.json new file mode 100644 index 00000000..6e27532c --- /dev/null +++ b/server.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json", + "name": "io.github.enterpilot/gomodel", + "title": "GoModel", + "description": "Self-hosted gateway aggregating upstream MCP servers behind one authenticated HTTP endpoint.", + "repository": { + "url": "https://github.com/ENTERPILOT/GoModel", + "source": "github" + }, + "version": "0.1.52", + "packages": [ + { + "registryType": "oci", + "identifier": "docker.io/enterpilot/gomodel:0.1.52", + "runtimeHint": "docker", + "transport": { + "type": "streamable-http", + "url": "http://localhost:8080/mcp" + }, + "environmentVariables": [ + { + "name": "GOMODEL_MASTER_KEY", + "description": "Gateway API key clients authenticate with; unset runs the gateway in unsafe (no-auth) mode.", + "isRequired": false, + "isSecret": true + }, + { + "name": "MCP_SERVERS", + "description": "JSON object of upstream MCP servers to aggregate, e.g. {\"github\":{\"url\":\"https://api.githubcopilot.com/mcp/\",\"headers\":{\"Authorization\":\"Bearer ${GITHUB_PAT}\"}}}. Servers can also be declared in config.yaml or the admin dashboard.", + "isRequired": false + } + ] + } + ] +}