Skip to content

feat(deploy): app worker backend management with MCP + skill#12

Merged
Chat2DB-Pro merged 1 commit into
mainfrom
feat/app-worker-management
Jun 20, 2026
Merged

feat(deploy): app worker backend management with MCP + skill#12
Chat2DB-Pro merged 1 commit into
mainfrom
feat/app-worker-management

Conversation

@Chat2DB-Pro

Copy link
Copy Markdown
Contributor

Summary

Adds a control-plane management layer for deployed app workers (Cloudflare full-app workers — server module + bundled assets on a shared Workers-for-Platforms dispatch namespace). Previously the feature only had a deploy endpoint; you could ship an app worker but not list, inspect, or undeploy one. This PR closes that loop and wires it through MCP and the nubase skill.

What's included

Backend (control plane)

  • AppWorkerDeployer gains 404-tolerant get / delete; CloudflareAppWorkerDeployer implements them via dispatch-namespace GET / DELETE (get → exists=false when absent, delete → idempotent). executeCloudflare refactored with an allowNotFound variant.
  • New AppWorkerService does tenant-scoped list / get / delete.
  • AppDeploymentAdminController (@RequireServiceRole) adds GET /deployments/admin/v1/app-workers, GET .../{workerName}, DELETE .../{workerName}.

MCP

  • DeploymentsMcpTools: appWorkersList (read), appWorkerStatus (read, with live provider state), appWorkerDelete (write, gated on service_role).
  • Frontend bridge: app_workers_list / app_worker_status / app_worker_delete in tools.ts + nubase-client.ts.

Skill

  • New references/app-workers.md, linked from SKILL.md (reference list + read/write tool inventories).

Tenant safety

The dispatch namespace is shared across all tenants, so management never enumerates the namespace — ownership is derived solely from the project's own app_deployments history (manifest_summary.type == "app_worker", latest per workerName, case-insensitive). requireOwned() rejects any worker not owned by the calling project, so a project can never read or delete another tenant's worker. Deletes write an app_worker_delete audit row.

Additionally, the deploy path now rejects a custom workerName that isn't namespaced under the project: it must equal appCode or start with appCode- (403 otherwise), closing a pre-existing cross-tenant naming-collision gap at the deploy boundary.

Tests

  • New AppWorkerServiceTest (ownership scoping + list/get/delete), extended CloudflareAppWorkerDeployerTest (get/delete + 404 cases), extended AppWorkerDeployServiceTest (workerName prefix accept/reject), appWorkerDelete service-role parity in RemoteAdminMcpToolsTest, updated McpConfigTest constructor.
  • Java: mvn -o test on the affected classes → all green. Frontend: tsc build clean + node --test → 118 passed (incl. new app-worker tool dispatch test).

🤖 Generated with Claude Code

Add control-plane management for deployed app workers (Cloudflare
full-app workers) on top of the existing deploy-only endpoint.

- Backend: AppWorkerDeployer gains 404-tolerant get/delete (Cloudflare
  dispatch-namespace GET/DELETE); new AppWorkerService does
  tenant-scoped list/get/delete; admin endpoints GET/DELETE under
  /deployments/admin/v1/app-workers.
- MCP: appWorkersList/appWorkerStatus/appWorkerDelete on
  DeploymentsMcpTools (delete gated on service_role).
- Frontend bridge + skill: app_workers_list/status/delete tools and a
  new references/app-workers.md reference.
- Tenant safety: the dispatch namespace is shared, so ownership is
  derived only from the project's own app_deployments history (never
  namespace enumeration); custom workerName must equal appCode or be
  namespaced under appCode- (403 otherwise).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Chat2DB-Pro Chat2DB-Pro merged commit 753b893 into main Jun 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants