A task backend for coding agents. Deploys to your Cloudflare account in one prompt.
Paste this into opencode, Claude Code, or Codex — your agent installs it for you.
Already deployed? Connect your agent in one line →
Install and deploy the open-source "Cloud Tasks" project into my own Cloudflare account, then tell me how to connect this agent to it. Do every step for me and pause only when you need my input (for example, to approve a login).
1. Clone the repo and work inside it:
git clone https://github.com/onurkerem/cloud-tasks.git
The Worker source lives in packages/worker/ — run every command from there.
2. Run: npm install
3. Authenticate Wrangler. Run: npx wrangler login
Tell me to complete the browser approval. If I can't use a browser, ask me for a CLOUDFLARE_API_TOKEN instead.
4. Create the D1 database and write its id into wrangler.jsonc:
npm run deploy:prepare
5. Apply the schema to the remote database:
npm run db:migrate:remote
6. Generate a strong API key (32 random hex bytes) and store it as a Worker secret for REST API use:
npx wrangler secret put API_KEY
Enter the generated value and remember it.
7. Configure Cloudflare Access for the MCP endpoint. Create a Self-hosted Access application for <worker-url>/mcp, then store:
npx wrangler secret put CF_ACCESS_TEAM_DOMAIN
npx wrangler secret put CF_ACCESS_POLICY_AUD
If I do not have the Access application yet, pause and tell me the exact dashboard steps.
8. Deploy the Worker:
npm run deploy
9. Capture the deployed URL (https://cloud-tasks.<my-subdomain>.workers.dev, or your custom domain if you added one) and run the REST production smoke test:
WORKER_URL=<that url> API_KEY=<the key> npm run smoke:prod
If anything fails, read the error, fix it, and retry.
10. Do NOT modify this agent's own config. When done, report back:
- the Worker URL,
- the API_KEY value,
- the REST API index (<url>/api),
- the OAuth MCP endpoint (<url>/mcp), protected by Cloudflare Access,
- the API-key MCP endpoint (<url>/api/mcp), authenticated with the API_KEY secret (no OAuth — ideal for persistent local MCP clients). Every task is a durable record in Cloudflare D1 — description, tags, assignee, and status (todo / in_progress / done) — indexed for fast filtered queries.
A REST CRUD API at /api/tasks and a Model
Context Protocol endpoint — /mcp (Cloudflare
Access) or /api/mcp (API key) — that exposes the
same data as agent tools.
REST and /api/mcp are gated by an API key (Authorization: Bearer or x-api-key); the /mcp endpoint is protected by Cloudflare Access. Runs entirely on Cloudflare's free-tier
Workers + D1.
Your coding agent talks to a single MCP endpoint. The Worker turns each tool call into a D1 query and returns the result.
opencode · Claude Code · Codex
POST /mcp · Cloudflare Access
Persistent task records
MCP tools exposed at /mcp
Talk to Cloud Tasks however you like — raw REST for scripts and dashboards, or the MCP
endpoint for agents. REST and /api/mcp use your API
key; /mcp uses Cloudflare Access and Managed OAuth.
Create tasks with tags and an assignee; filter by status, assignee, tag, or free text.
Atomically claim the oldest todo task — perfect
for multi-agent work queues.
Point any MCP-compatible agent at /mcp and it
gets six task tools out of the box.
Already deployed?
Hosted MCP uses Cloudflare Access. The legacy installer remains for older API-key MCP deployments and backs up every file before it touches a thing.
Supported agents
curl -fsSL https://raw.githubusercontent.com/onurkerem/cloud-tasks/main/packages/website/public/install.sh | bash
Works on macOS and Linux. Requires bash +
python3. Review it first on
GitHub.
Clone the repo and run the deploy script — wrangler.jsonc already
ships with a placeholder D1 id. Everything lives in
packages/worker/.
packages/worker/wrangler.jsonc
{
"name": "cloud-tasks",
"main": "src/index.ts",
"compatibility_date": "2026-06-18",
"compatibility_flags": ["nodejs_compat"],
"d1_databases": [
{
"binding": "DB",
"database_name": "cloud-tasks",
"database_id": "00000000-0000-0000-0000-000000000000",
"migrations_dir": "migrations"
}
]
} packages/worker/.dev.vars
API_KEY=replace-with-a-long-random-secret
CF_ACCESS_TEAM_DOMAIN=https://your-team.cloudflareaccess.com
CF_ACCESS_POLICY_AUD=your-access-aud-tag key
Set the production secret with
wrangler secret put API_KEY.
npx wrangler login
npm run deploy:prepare
npm run db:migrate:remote
npx wrangler secret put API_KEY
npx wrangler secret put CF_ACCESS_TEAM_DOMAIN
npx wrangler secret put CF_ACCESS_POLICY_AUD
npm run deploy Need an API token or your account ID? Grab them from the Cloudflare dashboard open_in_new.