SuperAPI AI Directory

moltworker

Cloudflare's open-source framework for deploying personal AI agents on Workers with sandboxed execution.

Open website

About this tool

Purpose

moltworker is used to run the OpenClaw (formerly known as Moltbot, Clawdbot) personal AI assistant on Cloudflare Workers. It packages OpenClaw into a Cloudflare Sandbox container, providing a fully managed, always-on deployment method without needing to host your own server. The project is positioned as a proof of concept, is not officially supported, may stop working at any time, and is used at your own risk.

Main Capabilities

  • Run the OpenClaw personal AI assistant in a Cloudflare Sandbox container.
  • Control UI: a web chat interface provided by the gateway.
  • Multi-channel support: Telegram, Discord, Slack.
  • Device pairing: secure private message authentication, requiring explicit approval.
  • Persistent sessions: retain chat history and context across sessions.
  • Agent runtime: extensible AI capabilities, including workspace and skills.
  • Optional R2 storage: enables data persistence after container restarts.
  • Optional browser automation (CDP shim): supports web scraping, screenshots, automated testing, etc.
  • Optional Cloudflare AI Gateway: for caching, rate limiting, analytics, and cost tracking.
  • Built-in skills: skills preinstalled in the container under /root/clawd/skills/, such as cloudflare-browser (including screenshot.js, video.js, cdp-client.js).

Usage

  1. Prerequisites: Workers paid plan ($5/month, required for Cloudflare Sandbox containers); Anthropic API key (for Claude access), or use AI Gateway's unified billing. Cloudflare Access, Browser Rendering, AI Gateway, and R2 Storage have free quotas.
  2. After deployment, open the Control UI using the token: replace your-worker with the actual worker subdomain, and YOUR_GATEWAY_TOKEN with the generated token. The first request may take 1-2 minutes while waiting for the container to start.
  3. Required: set up Cloudflare Access to protect the admin interface; pair devices through the /_admin/ admin interface.
  4. It is recommended to enable R2 storage so that paired devices and session history are retained after container restarts.
  5. The admin interface /_admin/ requires Cloudflare Access authentication (for local development, DEV_MODE=true can be set).
  6. Local development: create a .dev.vars file; device pairing authentication is used by default, and new devices must be approved via /_admin/.
  7. Gateway token: when accessing the Control UI remotely, the token must be passed via a query parameter; even if the token is valid, new devices still need approval via /_admin/.
  8. Persistent storage (R2): create an R2 API Token (Object Read & Write permission), select the moltbot-data bucket, and copy the Access Key ID and Secret Access Key; when the container starts, if R2 has backup data it is restored to the configuration directory, and during operation it syncs every 5 minutes; manual backup is also possible in the admin interface.
  9. Container lifecycle: always on by default (SANDBOX_SLEEP_AFTER=never), cold start takes 1-2 minutes; idle sleep can be configured to reduce costs.
  10. Debug endpoints: after enabling DEBUG_ROUTES=true and passing through Cloudflare Access, /debug/processes, /debug/logs, and /debug/version can be accessed.
  11. Optional chat channels, browser automation (CDP), Cloudflare AI Gateway (set three required secrets; the model can be specified with CF_AI_GATEWAY_MODEL in provider/model-id format).

Applicable Scenarios

  • Users who want to deploy a personal AI assistant in a fully managed way without building their own server.
  • Scenarios that need to use an AI assistant across multiple channels such as Telegram, Discord, and Slack.
  • Security-sensitive scenarios that require device pairing and access control.
  • Agent tasks that require browser automation (scraping, screenshots, testing).
  • Personal assistant deployments that require persistent sessions and configuration.

Limitations

  • Experimental project, not officially supported, may stop working at any time.
  • Requires a Workers paid plan($5/month), container runtime incurs additional compute charges.
  • Requires an Anthropic API key or AI Gateway unified billing.
  • Cold start takes 1-2 minutes.
  • R2 mounts are only effective in the production environment and are unavailable under wrangler dev.
  • In local development, wrangler dev has known limitations with WebSocket proxying; HTTP works but WebSocket may fail.
  • On Windows, Git may check out scripts with CRLF, causing start-openclaw.sh to exit with code 126; LF line endings must be configured.
  • The device list command takes 10-15 seconds due to WebSocket connection overhead.
  • Only one provider can be used at a time through the gateway; multiple providers require using direct keys.
  • The legacy AI_GATEWAY_API_KEY + AI_GATEWAY_BASE_URL configuration is still supported but deprecated.