feat: fetch OpenAPI spec from R2 binding instead of bundling - #11
Merged
Conversation
mattzcarey
force-pushed
the
fix/json-spec-fetching
branch
5 times, most recently
from
February 16, 2026 13:57
a3fe280 to
923c63b
Compare
4 tasks
mattzcarey
force-pushed
the
fix/json-spec-fetching
branch
3 times, most recently
from
February 16, 2026 14:07
70ebe7a to
19fb952
Compare
Replace build-time spec bundling with runtime fetching from R2, cached at each PoP via Cloudflare HTTP cache. - Add scheduled handler (daily cron) to fetch spec from GitHub, resolve $refs, and write spec.json + products.json to R2 - Serve /spec.json and /products.json from R2 in default handler - Search executor and server fetch via cached self-request - Extract shared spec-processor module for processing logic - Extract fetch-cached module for cached data fetching - Add scripts/seed-r2.ts for manually seeding staging/prod R2 - Delete build-spec.ts and static products.ts (no longer needed)
mattzcarey
force-pushed
the
fix/json-spec-fetching
branch
from
February 16, 2026 14:18
19fb952 to
38fa389
Compare
mattzcarey
added a commit
that referenced
this pull request
Feb 16, 2026
Replace build-time spec bundling with runtime fetching from R2, cached at each PoP via Cloudflare HTTP cache. - Add scheduled handler (daily cron) to fetch spec from GitHub, resolve $refs, and write spec.json + products.json to R2 - Serve /spec.json and /products.json from R2 in default handler - Search executor and server fetch via cached self-request - Extract shared spec-processor module for processing logic - Extract fetch-cached module for cached data fetching - Add scripts/seed-r2.ts for manually seeding staging/prod R2 - Delete build-spec.ts and static products.ts (no longer needed)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$refsresolved) was previously imported at build time and embedded into every deployment.SPEC_BUCKETR2 binding — no HTTP routes or caching layer needed.0 0 * * *UTC) with ascheduled()handler that fetches the latest spec from GitHub, resolves$refs, and writes bothspec.jsonandproducts.jsonto R2.src/spec-processor.tswith full test coverage.account_idoptional in the execute tool — auto-selects for single-account users, shows a picker for multi-account (incorporates fix: account ID negotiation for multi-account OAuth users #8).security-fullandfull-accesstemplates, trimsread-onlyto essential scopes. See OAuth fails when too many scopes are requested #12 for the scope limit issue.OPENAPI_SPEC_URLas an environment variable across all environments.scripts/seed-r2.ts) for populating staging/production R2 buckets.How it works
Closes #8
Test plan
npm run check)mcp-spec-staging)read-only,workers-full,dns-fulltemplates