SYSTEM Cited by 1 source
Moltworker¶
Moltworker (github.com/cloudflare/moltworker) is Cloudflare's open-source port of Moltbot onto the Developer Platform. It is explicitly labelled a proof of concept, not a Cloudflare product — the goal is to showcase how the Developer Platform's building blocks compose to host an AI-agent workload that normally assumes dedicated local hardware.
Architecture¶
Moltworker is a middleware Worker (see patterns/middleware-worker-adapter) threading Moltbot's requirements into Cloudflare primitives:
- Entrypoint Worker — API router + proxy between Moltbot (running in the container) and the rest of Cloudflare's APIs. Also hosts an Admin UI.
- Zero Trust Access — declarative auth for the Admin UI + API; the Worker validates the Access JWT on every request.
- Sandbox SDK — spawns and
drives a per-user Cloudflare Container hosting Moltbot's Gateway
runtime.
getSandbox(env.Sandbox, 'user-123')gives per-user isolation. - R2 via
sandbox.mountBucket()— mounts an R2 bucket as a filesystem partition inside the container, giving Moltbot durable storage for session memory and conversations (patterns/mountable-persistent-storage). - Browser Rendering via a thin CDP proxy — Moltbot drives a local CDP port inside the container; the proxy forwards CDP frames back through the Worker to Browser Rendering's Puppeteer APIs, and a Browser Rendering skill is injected into Moltbot's runtime at Sandbox start (patterns/cdp-proxy-for-headless-browser).
- AI Gateway — Moltbot's LLM
calls are redirected through AI Gateway by setting
ANTHROPIC_BASE_URL(no Moltbot code changes), enabling BYOK, Unified Billing, provider/model fallbacks, and centralised observability (patterns/ai-gateway-provider-abstraction).
Why it matters¶
- Zero-change port of an existing Docker-based agent to Cloudflare. Every Moltbot assumption (local filesystem, local Chromium, local Anthropic client, Docker-run runtime, app-level auth) maps to a managed primitive without rewriting Moltbot.
- Reference architecture for AI agents on the Developer Platform — companion to Cloudflare's internal AI engineering stack writeup, which covers the same primitives at the enterprise-scale dogfood tier.
Requirements¶
- Workers Paid plan — needed for Sandbox Containers.
- All other services (AI Gateway, R2, Access) are on free or free-tier plans.
Seen in¶
- sources/2026-01-29-cloudflare-moltworker-self-hosted-ai-agent — the post introducing Moltworker. Canonical wiki instance of the four patterns Moltworker composes (middleware-worker-adapter, mountable-persistent-storage, cdp-proxy-for-headless-browser, ai-gateway-provider-abstraction).
Related¶
- systems/moltbot — the agent being ported.
- systems/cloudflare-workers — the entrypoint compute tier.
- systems/cloudflare-sandbox-sdk — the container runtime.
- systems/cloudflare-browser-rendering — the browser-automation tier.
- systems/cloudflare-ai-gateway — the LLM-proxy tier.
- systems/cloudflare-r2 — the durable-filesystem backing.
- systems/cloudflare-zero-trust-access — the auth gate.
- companies/cloudflare — author + operator.