What you need
- A Cloudflare account on Workers Paid (the email binding needs it) and a domain in that account. Below,
example.comstands for it andapi.example.comfor the server. - Node and pnpm, in the versions of
.nvmrcandpackage.json, and a Mac with Xcode and XcodeGen for the app. - Wrangler logged in to your account:
pnpm --filter @todz/api exec wrangler login.
1. Fork, install and check
Fork the repository, then, before renaming anything:2. Rename
Editapps/api/wrangler.jsonc:
account_id: your account’s id.routes: replaceapi.todz.app,todz.appandwww.todz.appwithapi.example.com,example.comandwww.example.com, keepingcustom_domaintrue.vars.PUBLIC_ORIGIN:https://api.example.com.vars.SITE_ORIGIN:https://example.com, where the landing page and this guide are served.send_email[0].allowed_sender_addresses: your sender, for example[email protected].ratelimits: keep the nine bindings, three each for sign-in, the waitlist and the admin; change eachnamespace_idif your account already uses8601to8609.
vars.SIGN_IN_PROVIDER stays email, vars.EMAIL_SENDER stays cloudflare, and workers_dev and preview_urls stay false. Never pass --var to wrangler deploy, and never set variables in the dashboard: a fake provider, or a sender that only logs the link, opens sign-in to anyone.
In apps/api/src/email-sender.ts, set SENDER_ADDRESS and REPLY_TO_ADDRESS to your own addresses.
3. Create the database and apply the migrations
d1_databases[0].database_id, then:
4. Deploy
todz server ready: https://api.example.com → paste it in todz › Settings › Server: that is the URL step 7 uses. Cloudflare creates the DNS records and the certificates for api.example.com, example.com and www.example.com; none of the three may already have an A, AAAA or CNAME record. Check four things:
curl -sS https://api.example.com/owner/sign-in-methodanswers{"method":"link"};curl -sS https://api.example.com/healthanswers{"service":"todz","origin":"https://api.example.com"};- the account’s
todz-api.<subdomain>.workers.devaddress does not answer; - until step 6 is done, sending a link answers 503
sign_in_unavailable, which is the safe state.
5. Email sending
Enable sending for your domain and add the records Cloudflare lists. The zone id is on the domain’s Overview page in the dashboard.6. Turnstile
Sign-in, the waitlist and the admin stay closed (sign_in_unavailable, “The waitlist opens soon.” and “The admin is closed right now.”) until Turnstile is set up. In the Cloudflare dashboard, create a Turnstile widget for example.com in Managed mode. Put its site key in vars.TURNSTILE_SITE_KEY in apps/api/wrangler.jsonc, deploy again with pnpm --filter @todz/api server:deploy, and store its secret:
wrangler.jsonc.
The admin at https://example.com/admin, where you read and export the waitlist, signs in only the address you store the same way; until you do, it stays closed:
triggers in apps/api/wrangler.jsonc; without the secret the cron sends nothing and each run fails in the Worker’s Cron Events; set "crons": [] there to turn the digest off.
7. Build the macOS app and point it at your server
Inapps/macos/project.yml:
- in both targets, replace
DEVELOPMENT_TEAMwith your own team’s id (Xcode → Settings → Accounts; the free Personal Team works); - replace
bundleIdPrefix, theTODZ_APP_BUNDLE_IDENTIFIERandTODZ_WIDGETS_BUNDLE_IDENTIFIERvalues andTODZ_APP_GROUPwith identifiers of your own.
todz, and the server needs no setting for it, because the app names its scheme when it asks for a link.
Then open todz › Settings › Server and paste the URL the deploy printed. The app checks it, signs out of the server it was on and starts clean on yours. Sign in with your email, then open Connect an Agent in the sidebar.
8. Point an MCP client at your server
Connect an Agent shows a ready command with your server and a new key. For Claude Code it has this shape:Updating
Pull from upstream. Update the server first, then the app: an app newer than its server cannot check the server’s address. Run:wrangler rollback or the dashboard’s Deployments page. To close sign-in, delete the secret: