From aadda24fb202a18b533d0f08be572015a82286cc Mon Sep 17 00:00:00 2001 From: Radoslav Dimitrov Date: Tue, 21 Apr 2026 20:34:56 +0300 Subject: [PATCH] Ship a pre-bundled upstream-registry schema variant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a `upstream-registry.bundled.schema.json` release asset alongside the raw schema. The bundled version replaces the two remote $refs to the MCP server schema with inline placeholder objects that carry the schema URL in their descriptions. Motivation: JSON-Schema viewer plugins (in particular the one used by stacklok/docs-website) cannot resolve remote $refs at render time, so they currently run a post-download bundling step themselves. Shipping a pre-bundled variant lets them skip that step. The raw schema stays as the canonical source — existing consumers are unaffected. Purely additive: one new release asset, no changes to the existing uploads. Uses jq (already on the runner) — no new dependencies or tooling in this repo. Paired with the docs-website automation rollup in https://github.com/stacklok/docs-website/pull/748. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/release.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9470bd4..31dbcf5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,30 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Produce bundled upstream-registry schema + # Ships a bundled variant alongside the raw schema. The bundled + # version replaces the remote $refs to the MCP server schema + # with inline placeholder objects, letting JSON Schema viewers + # render the file without runtime ref resolution. Raw schema + # remains the canonical source. + run: | + mkdir -p build + jq ' + (.. | objects | select(.["$ref"] == "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json")) |= + { + type: "object", + description: "MCP server object — see MCP server schema: https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json" + } + ' registry/types/data/upstream-registry.schema.json \ + > build/upstream-registry.bundled.schema.json + + # Sanity check: the MCP server URL should no longer appear as + # a $ref anywhere in the bundled output (only in descriptions). + if jq -e '[.. | objects | .["$ref"]? | select(. != null and (contains("static.modelcontextprotocol.io")))] | length > 0' build/upstream-registry.bundled.schema.json > /dev/null; then + echo "::error::Bundling failed: MCP server \$refs were not rewritten. The MCP server URL may have changed; update the jq filter above." + exit 1 + fi + - name: Upload schema artifacts to release env: GH_TOKEN: ${{ github.token }} @@ -25,6 +49,7 @@ jobs: gh release upload "${{ github.ref_name }}" \ registry/types/data/skill.schema.json \ registry/types/data/upstream-registry.schema.json \ + build/upstream-registry.bundled.schema.json \ registry/types/data/publisher-provided.schema.json \ registry/types/data/toolhive-legacy-registry.schema.json \ --clobber \ No newline at end of file