$5 stack runbook
Step-by-step: deploy the whole P31 stack on one Cloudflare Workers Paid account. Allowances and overage rates are Cloudflare's published numbers, retrieved 2026-10-13.
What you need
- One Cloudflare account (free to create).
- Node.js and npm installed, and
npx wrangler— no global install needed, every command below works through npx. - The P31 source. The hub lives in github.com/p31labs/production under
apps/p31ca, the MCP servers underworkers/. - One credit card for the $5/month plan. That is the whole infrastructure budget at family scale.
Step 1 — turn on the Workers Paid plan
In the dashboard (dash.cloudflare.com), open Workers & Pages and switch the account to the Workers Paid plan. It is a flat $5/month per account — there are no per-seat charges, and data transfer (egress) and bandwidth are not billed. Everything in this runbook runs on that one plan.
Read the plan's own page before you pay: Cloudflare Workers pricing (retrieved 2026-10-13).
Step 2 — what the $5 includes
The table below is the plan's published included usage and overage rates, one row per service this stack uses. All figures retrieved 2026-10-13 from Cloudflare's pricing docs — each row links to its page.
| Service | Included per month | Overage |
|---|---|---|
| Workers (includes Pages Functions) ↗ | 10M requests/mo · 30M CPU-milliseconds/mo · no duration charge | +$0.30 per 1M requests · +$0.02 per 1M CPU-ms |
| Pages static assets ↗ | Unlimited requests · unlimited bandwidth | None — free and unlimited |
| Workers KV ↗ | 10M reads/mo · 1M writes/mo · 1M deletes/mo · 1M list ops/mo · 1 GB stored | +$0.50 per 1M reads · +$5.00 per 1M writes/deletes/lists · +$0.50 per GB-month |
| D1 (SQLite) ↗ | 25B rows read/mo · 50M rows written/mo · 5 GB storage | +$0.001 per 1M rows read · +$1.00 per 1M rows written · +$0.75 per GB-month |
| Queues ↗ | 1M operations/mo · 4-day default retention (up to 14) | +$0.40 per 1M operations |
| Durable Objects ↗ | 1M requests/mo · 400,000 GB-seconds/mo · SQLite storage shares the D1 row allowances | +$0.15 per 1M requests · +$12.50 per 1M GB-seconds |
| Workers AI ↗ | 10,000 neurons/day free on every plan | $0.011 per 1,000 neurons beyond the daily free allocation |
| R2 (object storage) ↗ | 10 GB stored · zero egress at any volume | $0.015 per GB-month stored · no egress charge, ever |
| Workers Logs ↗ | 20M log events written/mo | +$0.60 per 1M events |
Step 3 — the pages first
The hub and the portals are Cloudflare Pages projects — static output plus Pages Functions. Static asset requests are free and unlimited; Functions bill as Workers against the allowance table above.
npx wrangler login
npx wrangler pages project create p31ca --production-branch main
cd apps/p31ca
npm run build
npx wrangler pages deploy dist --project-name p31ca --branch=main
Repeat for each portal you run. The hub's own deploy script is exactly this — see npm run deploy in apps/p31ca/package.json.
Step 4 — the MCP servers
Each MCP server is one Worker. The operator's current local set is 16 servers (the registry, crypto, wallet, marketplace, and the room workers) — deploy the ones your household uses; the same account hosts all of them, and Worker-to-Worker calls through service bindings add no extra request charges.
cd workers/mcp-registry
npx wrangler deploy
Then register the servers in the registry so clients can discover them. The registry publishes the fleet at /servers and the audit chain at /audit.
Step 5 — databases, KV, Queues, Durable Objects
- D1. Create one database per ledger:
npx wrangler d1 create loom, then bind it inwrangler.toml. The Loom's hash-chained log lives here; a family-scale log (thousands of rows a month) is orders of magnitude inside the 25 billion rows read allowance. - KV. One namespace for the registry catalog. Included: 10M reads and 1M writes per month.
- Queues. One queue for async work (registry ingest, notifications). Included: 1M operations per month.
- Durable Objects. The registry's audit and transparency ledgers are Durable Object classes — one instance per log name. Included: 1M requests and 400,000 GB-seconds per month.
Step 6 — Workers AI
Add an AI binding to any Worker that needs inference. Every account gets 10,000 free neurons per day — enough for a household's daily assistive use at zero cost; anything beyond the daily free allocation bills at $0.011 per 1,000 neurons. A few frontier models require the Paid plan (or prepaid AI Gateway credits) to call at all — the pricing page lists them. Source: Workers AI pricing (retrieved 2026-10-13).
Step 7 — what stays inside the $5
Honest arithmetic, not a bill: a family-scale deployment — the hub and portals on Pages (static requests free), 16 MCP Workers serving household traffic, D1 ledgers in the thousands of rows, a registry in KV, one queue, two Durable Objects, and daily Workers AI use under the free neurons — sits comfortably inside every allowance in the Step 2 table. The only recurring charge is the $5 plan itself.
Overage would only start if the deployment outgrew the included allowances — for example past 10 million requests a month (which is over 13 requests per second, all month). Those rates are in the table too, so the worst case is knowable in advance. Set a usage alert in the dashboard if you want a ceiling you can feel.
This is architecture math for the pattern above. It is an estimate, and it is not a statement of P31 Labs' actual bill.
Where the numbers come from
- Workers platform pricing
- D1 pricing
- KV pricing
- Queues pricing
- Durable Objects pricing
- Workers AI pricing
- R2 pricing
- Pages Functions pricing
All rates retrieved 2026-10-13. Cloudflare updates its pricing pages; the links are the living source.