Repository navigation
feat: build every API artifact from Forge in a daily container and serve mcp-tools.json directly - #247
Open
mattzcarey wants to merge 1 commit into
Open
feat: build every API artifact from Forge in a daily container and serve mcp-tools.json directly#247mattzcarey wants to merge 1 commit into
mattzcarey wants to merge 1 commit into
Conversation
This was referenced Oct 7, 2026
Member
Author
|
Running log of inconsistencies in Forge's OpenAPI document that affect the MCP tools and structured output (envelope conventions, nullability, value constraints, coverage gaps), with counts and real-response examples from staging. I'll keep it updated as testing continues: https://gist.github.com/mattzcarey/52b3e08c64a5b4101a3a02f24387665b |
…rve mcp-tools.json directly A ToolsBuilder Durable Object runs the bundled generator in a managed cloudflare/debian-trixie container with no internet access. BuildEgress is its only way out: GET forge.internal returns the newest Forge release and PUT artifacts.internal stores spec.json, products.json and mcp-tools.json. ?codemode=false serves mcp-tools.json as generated: cf CLI tool names, typed nested inputs, annotations, and account_id optional everywhere. The GitHub spec cron, OPENAPI_SPEC_URL and the Worker-side spec processing are gone.
mattzcarey
force-pushed
the
feat/forge-tools
branch
from
October 7, 2026 15:17
a6efc28 to
f3e4ccc
Compare
This was referenced Oct 7, 2026
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.
Builds every API artifact the Worker serves from Forge's
openapi.forge.json, once a day in a container, and serves?codemode=falsefrom the generatedmcp-tools.jsondirectly.ctx.container,durable_objectscheduling policy, managedcloudflare/debian-trixieimage. No Dockerfile, no image build, no@cloudflare/containers.interceptOutboundHttproutes two hostnames toBuildEgress(aWorkerEntrypoint):GET forge.internal/openapi.forge.jsonandPUT artifacts.internal/<key>for the three artifact keys. Everything else gets a403. The container holds no bindings or credentials.scripts/generator/): walks Forge's command tree the way thecfCLI generator does, so tool names matchcfcommands (cf dns records create→dns_records_create). Request bodies keep the API's nested JSON Schema 2020-12 shape, with$defsfor recursive schemas.account_idis optional everywhere. It also writesspec.json(all$refs resolved) andproducts.jsonfor Code Mode.npm run build:generatorbundles it with esbuild intogenerated/tools-generator.mjs.txt(gitignored), which the Worker imports as a text module. Wrangler'sbuild.commandruns it beforedevanddeploy.src/tools/non-codemode.tsservestools/listfrom the artifact as-is and dispatchestools/callfrom the entry's routing metadata.src/isolate-cache.tscaches the artifacts per isolate for an hour.OPENAPI_SPEC_URL,src/spec-processor.ts, and the old operation-to-tool code insrc/openapi.ts(only thesearchtypes stay). One cron (0 0 * * *) remains.vendor/cloudflare-forge-0.1.0.tgz, packed from publiccloudflare/forgemain, ascfdoes until Forge is on npm.Warning
Breaking for
?codemode=falseusers: all tool names change to thecfcommand names (main's 3,659 operationId-based names; none survive). Code Mode (search/execute) is unaffected.Tooling
durable_objectandexec().@cloudflare/vitest-pool-workers0.16 → 0.22. It bundles wrangler 4.124, which rejects the container config, sooverridespoints it at the project's wrangler. Drop the override once the pool catches up.globalThis.fetchread-only, sotests/fetch-retry.test.tsandtests/non-codemode.test.tsmock withvi.stubGlobal.@cloudflare/forge(vendored),ajv(generator schema tests),esbuild(pinned to wrangler's version).dev.enable_containers: false, sowrangler devdoesn't need Docker.npm run seed:localgenerates the artifacts from the newest Forge release into local R2.Notes
durable_objectpolicy is in beta, and a container's policy can't be changed after it's created.tests/tools-builder.test.tscovers everything around the container for real:BuildEgressthrough thectx.exportsloopback, the Forge download (GitHub mocked with MSW), R2 writes, and the scheduled handler's dispatch.forgeRelease.