Cloud Tasks

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 →

agent prompt
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. Reset the D1 binding so a fresh database is created in MY account. In packages/worker/wrangler.jsonc, set d1_databases[0].database_id to "00000000-0000-0000-0000-000000000000".

3. Run: npm install

4. 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.

5. Create the D1 database and write its id back into wrangler.jsonc:
   npm run deploy:prepare

6. Apply the schema to the remote database:
   npm run db:migrate:remote

7. Generate a strong API key (32 random hex bytes) and store it as a Worker secret:
   npx wrangler secret put API_KEY
   Enter the generated value and remember it.

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 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 MCP endpoint (<url>/mcp), called with the header: Authorization: Bearer <API_KEY>.

Built for agents, ready in minutes

database

D1-backed task store

Every task is a durable record in Cloudflare D1 — description, tags, assignee, and status (todo / in_progress / done) — indexed for fast filtered queries.

hub

Two APIs, one backend

A REST CRUD API at /api/tasks and a Model Context Protocol endpoint at /mcp that exposes the same data as agent tools.

shield

Secure by default, free to run

Every request is gated by an API key (Authorization: Bearer or x-api-key). Runs entirely on Cloudflare's free-tier Workers + D1.

How it works

Your coding agent talks to a single MCP endpoint. The Worker turns each tool call into a D1 query and returns the result.

smart_toy

Your agent

opencode · Claude Code · Codex

arrow_downward
cloud

Cloud Tasks Worker

POST /mcp · Bearer API key

arrow_downward
database

Cloudflare D1

Persistent task records

MCP tools exposed at /mcp

create_task list_tasks get_task update_task delete_task claim_next_task

Usage

Talk to Cloud Tasks however you like — raw REST for scripts and dashboards, or the MCP endpoint for agents. Both share one API key and one task store.

check_circle

Create tasks with tags and an assignee; filter by status, assignee, tag, or free text.

check_circle

Atomically claim the oldest todo task — perfect for multi-agent work queues.

check_circle

Point any MCP-compatible agent at /mcp and it gets six task tools out of the box.

REST
# Create a task
curl -X POST https://cloud-tasks.keremorenli.com/api/tasks
-H "Authorization: Bearer $API_KEY" -H "content-type: application/json"
-d '{"description":"Ship the API","tags":["backend"]}'
# Filter the backlog
curl -H "Authorization: Bearer $API_KEY"
"https://cloud-tasks.keremorenli.com/api/tasks?status=todo&tag=backend"
# Claim the next task (atomic)
curl -X POST https://cloud-tasks.keremorenli.com/api/tasks/claim
-d '{"assignee":"agent-b","tags":["backend"]}'
MCP
# List tools over the MCP endpoint
curl -X POST https://cloud-tasks.keremorenli.com/mcp
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Already deployed?

Connect your agent in one line

The installer asks for your MCP URL and API key, lets you pick agents, and safely wires Cloud Tasks into each one — backing up every file before it touches a thing.

  • check_circle Asks for your /mcp URL and API key (input hidden, never printed)
  • check_circle Pick any of: opencode, Claude Code, Codex, Antigravity
  • check_circle Merges only the cloud-tasks entry — your other config stays untouched
  • check_circle Backs up each file first; sets 600 perms on any file holding your key
  • check_circle Optional connectivity test against your endpoint before writing
  • check_circle Works on macOS and Linux; needs bash + python3

Supported agents

opencode Claude Code Codex Antigravity
one-line install
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.

Prefer the manual path?

Clone the repo, set a placeholder D1 id, and run the deploy script. 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

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
npm run deploy

Need an API token or your account ID? Grab them from the Cloudflare dashboard open_in_new.