add cfb_* MCP tools for Cloudflare Workers Builds management#14
Open
vibe-dex wants to merge 7 commits into
Open
add cfb_* MCP tools for Cloudflare Workers Builds management#14vibe-dex wants to merge 7 commits into
vibe-dex wants to merge 7 commits into
Conversation
14 new MCP tools across 5 shared UIs (cfb-setup, cfb-secrets, cfb-build-vars, cfb-builds, cfb-versions) that wrap the admin loaders/actions landing in deco-sites/admin#3170. Each tool is a thin callAdmin wrapper; no Cloudflare tokens live in this process. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Split api/main.ts into a shared createApp factory plus Bun and Workers entries. Resources are now factories that take a getClientHTML closure, so the Workers entry can read the bundled HTML via env.ASSETS.fetch while the Bun entry keeps using node:fs. Adds wrangler.toml with [assets] directory = "dist/client" (serves index.html + Monaco worker JS chunks) and an env.preview block for staging. Bump NODE_OPTIONS heap on build:web to fix the previous Vite OOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Brings the Workers-deploy refactor into the cfb-mcp branch so both PRs can ship together. Adapted the 5 cfb_* resources to the new createXAppResource(getClientHTML) factory pattern and added them to createApp()'s resources array. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
admin-mcp | 627f0a0 | Commit Preview URL Branch Preview URL |
May 13 2026, 12:38 AM |
# Conflicts: # api/app.ts
Admin's CloudflareBuildsClient.listBuilds passes `json.result` through
unchanged, but CF's Builds list endpoint may wrap results as
`{ items: [...] }` instead of returning a bare array — so the MCP
wrapper was receiving an object and failing output schema validation
with "expected array, received object". Mirror the same defense the
admin code already applies to `getBuildLogs` and `WorkerVersions.list`.
The real fix belongs in admin (clients/cloudflareBuilds.ts), but this
keeps the MCP unblocked.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Customer-facing MCP surface for the Cloudflare Workers Builds backend landing in deco-sites/admin#3170. Adds 14 new `cfb_*` tools across 5 shared UIs: setup (one-click + status), secrets, build vars, builds (list/get/logs/trigger), and versions (list/rollback). Each tool is a thin `callAdmin` wrapper — no Cloudflare tokens or business logic live in this process; tenancy is enforced upstream by admin.
Schemas mirror the admin Props/return types exactly. Five new resources point at the same single `dist/client/index.html` bundle (consistent with the existing pattern); routing is by `toolName` in `web/router.tsx`. UIs handle all `McpStatus` states, surface destructive-action confirmations, and the builds UI polls `cfb_get_build_logs` every 2s for running builds.
Test plan
🤖 Generated with Claude Code
Summary by cubic
Adds 14 customer-facing
cfb_*MCP tools with five shared UIs to onboard and manage Cloudflare Workers Builds (setup, secrets, build vars, builds, and version rollbacks) from the MCP host, and wires them into the Workers-ready app (createApp+ static asset serving viaASSETSandwrangler). Also fixescfb_list_buildsby normalizing admin responses to arrays to prevent schema errors.New Features
cfb_setup,cfb_setup_statusfor one-click onboarding and status.cfb_list_secrets,cfb_set_secret,cfb_delete_secret(names/types only; values never returned).cfb_list_build_vars,cfb_set_build_var,cfb_delete_build_var(plain text, non-secret).cfb_list_builds,cfb_get_build,cfb_get_build_logs,cfb_trigger_build; logs UI polls every 2s while running.cfb_list_versions,cfb_rollbackwith best-effort binding warnings.callAdminwrapper to admin endpoints in deco-sites/admin#3170; tenancy enforced upstream, no Cloudflare creds here.ui://mcp-app/*resources that all servedist/client/index.html;web/router.tsxmaps tools to shared pages;api/app.tsregisters all five resources.Migration
callAdmin(getConfig); no Cloudflare tokens are needed here.cfb_setup_status(read-only) or runcfb_setupto provision triggers and connect the repo.wrangler:bun run build:web && wrangler deploy(ordeploy:preview); static assets are served fromdist/clientvia theASSETSbinding. Optional: setDECO_ADMIN_URLinwrangler.jsoncto override the admin origin.Written for commit 627f0a0. Summary will update on new commits.