Skip to content

Commit aadda24

Browse files
rdimitrovclaude
andcommitted
Ship a pre-bundled upstream-registry schema variant
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 stacklok/docs-website#748. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6969c6f commit aadda24

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,38 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2020

21+
- name: Produce bundled upstream-registry schema
22+
# Ships a bundled variant alongside the raw schema. The bundled
23+
# version replaces the remote $refs to the MCP server schema
24+
# with inline placeholder objects, letting JSON Schema viewers
25+
# render the file without runtime ref resolution. Raw schema
26+
# remains the canonical source.
27+
run: |
28+
mkdir -p build
29+
jq '
30+
(.. | objects | select(.["$ref"] == "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json")) |=
31+
{
32+
type: "object",
33+
description: "MCP server object — see MCP server schema: https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json"
34+
}
35+
' registry/types/data/upstream-registry.schema.json \
36+
> build/upstream-registry.bundled.schema.json
37+
38+
# Sanity check: the MCP server URL should no longer appear as
39+
# a $ref anywhere in the bundled output (only in descriptions).
40+
if jq -e '[.. | objects | .["$ref"]? | select(. != null and (contains("static.modelcontextprotocol.io")))] | length > 0' build/upstream-registry.bundled.schema.json > /dev/null; then
41+
echo "::error::Bundling failed: MCP server \$refs were not rewritten. The MCP server URL may have changed; update the jq filter above."
42+
exit 1
43+
fi
44+
2145
- name: Upload schema artifacts to release
2246
env:
2347
GH_TOKEN: ${{ github.token }}
2448
run: |
2549
gh release upload "${{ github.ref_name }}" \
2650
registry/types/data/skill.schema.json \
2751
registry/types/data/upstream-registry.schema.json \
52+
build/upstream-registry.bundled.schema.json \
2853
registry/types/data/publisher-provided.schema.json \
2954
registry/types/data/toolhive-legacy-registry.schema.json \
3055
--clobber

0 commit comments

Comments
 (0)