diff --git a/.github/workflows/publish-mcp.yml b/.github/workflows/publish-mcp.yml new file mode 100644 index 0000000..b29cb7a --- /dev/null +++ b/.github/workflows/publish-mcp.yml @@ -0,0 +1,62 @@ +name: Publish to MCP Registry + +# Triggers when a new version tag (e.g., v2.7.1) is pushed. +# +# Note on publishing architecture: +# - Gated strictly behind `verify-live` to prevent publishing untested configurations. +# - Uses GitHub Actions OIDC (`id-token: write`) to securely authenticate +# under the repository namespace `io.github.hapheus/*` without static tokens. +# - Validates `server.json` before publishing. + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + +permissions: + contents: read + +jobs: + verify-live: + name: "Live Image Verification (Pre-Publish Gate)" + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Check out repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Run Live Image Verification + uses: ./.github/actions/live-verification + with: + image_ref: "torproxy:smoke-test" + build_local: "true" + run_alerts: "false" + dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} + + publish-mcp: + name: "Publish to MCP Registry" + needs: verify-live + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - name: Check out repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Install mcp-publisher + run: | + OS=$(uname -s | tr '[:upper:]' '[:lower:]') + ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') + curl -sSL "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_${OS}_${ARCH}.tar.gz" | tar xz mcp-publisher + chmod +x mcp-publisher + + - name: Validate server.json + run: ./mcp-publisher validate server.json + + - name: Authenticate with MCP Registry via GitHub OIDC + run: ./mcp-publisher login github-oidc + + - name: Publish server.json to MCP Registry + run: ./mcp-publisher publish server.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 4df514f..9a8ada5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.7.2] — 2026-11-10 + +### Added +- **ci**: Add automated GitHub Actions workflow to publish `server.json` to the official MCP Registry on release tags via GitHub OIDC (#134, #135) + ## [2.7.1] — 2026-11-10 ### Changed @@ -218,7 +223,8 @@ Sprint 1 security & contract correctness release. --- -[Unreleased]: https://github.com/hapheus/torproxy/compare/v2.7.1...HEAD +[Unreleased]: https://github.com/hapheus/torproxy/compare/v2.7.2...HEAD +[2.7.2]: https://github.com/hapheus/torproxy/compare/v2.7.1...v2.7.2 [2.7.1]: https://github.com/hapheus/torproxy/compare/v2.7.0...v2.7.1 [2.7.0]: https://github.com/hapheus/torproxy/compare/v2.6.2...v2.7.0 [2.6.2]: https://github.com/hapheus/torproxy/compare/v2.6.1...v2.6.2 diff --git a/docker/Dockerfile b/docker/Dockerfile index b9b88fd..49b4792 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -7,7 +7,7 @@ ARG PYTHON_VERSION=3.14 LABEL org.opencontainers.image.title="torproxy" \ org.opencontainers.image.description="A minimal HTTP proxy routed through Tor" \ - org.opencontainers.image.version="2.7.1" \ + org.opencontainers.image.version="2.7.2" \ org.opencontainers.image.licenses="MIT" \ org.opencontainers.image.source="https://github.com/hapheus/torproxy" \ org.opencontainers.image.url="https://github.com/hapheus/torproxy" diff --git a/docs/releases.md b/docs/releases.md index bc56ada..7762add 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -91,6 +91,10 @@ If an upgraded image exhibits unexpected behavior in your environment: ## 6. Release Notes +### 2.7.2 (MCP Registry automated publishing workflow) + +- **Automated MCP Registry Publish (#134, #135):** Added `.github/workflows/publish-mcp.yml` using GitHub Actions OIDC (`id-token: write`) to automatically publish the verified `server.json` to `registry.modelcontextprotocol.io` upon pushing release tags (`v*`). + ### 2.7.1 (Dependency and GitHub Actions updates) - **Dependency Updates (#130, #131):** Bumped `ruff` to 0.17.4 and updated GitHub Actions pin digests (CodeQL 4.39.3, docker/login-action 4.8.0, git-cliff-action 4.9.1, action-gh-release 3.0.4). diff --git a/pyproject.toml b/pyproject.toml index d199a76..c66bc57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "torproxy" -version = "2.7.1" +version = "2.7.2" description = "A minimal HTTP and SOCKS5 proxy routed through the Tor network with local REST control API" readme = "README.md" requires-python = ">=3.10" diff --git a/server.json b/server.json index 4764733..fe09350 100644 --- a/server.json +++ b/server.json @@ -3,7 +3,7 @@ "name": "io.github.hapheus/torproxy", "title": "torproxy", "description": "Tor HTTP and SOCKS5 proxy with REST API and built-in MCP server.", - "version": "2.7.1", + "version": "2.7.2", "repository": { "url": "https://github.com/hapheus/torproxy", "source": "github" @@ -11,7 +11,7 @@ "packages": [ { "registryType": "oci", - "identifier": "docker.io/hapheus/torproxy:2.7.1", + "identifier": "docker.io/hapheus/torproxy:2.7.2", "transport": { "type": "stdio" }, diff --git a/tests/unit/test_ci_workflows.py b/tests/unit/test_ci_workflows.py index 659e48e..c5178ef 100644 --- a/tests/unit/test_ci_workflows.py +++ b/tests/unit/test_ci_workflows.py @@ -113,6 +113,14 @@ def test_release_waits_for_live_verification() -> None: assert "verify-live" in release +def test_publish_mcp_waits_for_live_verification() -> None: + publish_mcp = _read("publish-mcp.yml") + assert "uses: ./.github/actions/live-verification" in publish_mcp + assert "needs: verify-live" in publish_mcp or "needs: [verify-live]" in publish_mcp + assert "id-token: write" in publish_mcp + assert "mcp-publisher login github-oidc" in publish_mcp + + def test_daily_canary_reuses_the_shared_action() -> None: daily = _read("daily-image-verification.yml") assert "schedule:" in daily diff --git a/uv.lock b/uv.lock index 831b417..2e1e254 100644 --- a/uv.lock +++ b/uv.lock @@ -842,7 +842,7 @@ wheels = [ [[package]] name = "torproxy" -version = "2.7.1" +version = "2.7.2" source = { editable = "." } [package.optional-dependencies]