01
Brad Paws Client Portal
A full-stack React 19 + Hono portal on Cloudflare Workers, running a live SF pet-care operation.
Live
Brad Paws is a pet-care business in SF, and this portal is its system of record. Dozens of clients and their pets run through it, with bookings and invoices processed every month. I treated a small operation as a place to build production patterns properly: I integrated the operator's existing tools instead of replacing them — Notion stayed the workspace, Google Calendar the scheduling source of truth, and the portal took over everything customer-facing. It's a TypeScript monorepo (client portal, API Worker, sync Worker, shared package) on Cloudflare Workers with D1, KV, R2, and Workflows, no origin server. The hard part was making external APIs feel local. I cache OAuth tokens in KV so 98% of Calendar operations never touch Google's auth endpoint.
React Router 7React 19HonoTypeScriptCloudflare WorkersD1 · KV · R2WorkflowsVitestPlaywright
30+active clients
60+bookings / month
30+invoices / month
98%fewer auth calls
Architecture & Infrastructure
- Architected a TypeScript monorepo (React Router 7 client portal, Hono API Worker, scheduled sync Worker, shared domain package) on a 23-table D1 schema, running on Cloudflare Workers, D1, KV, R2, and Workflows with no origin server
- Chose this stack around one constraint — the operator never manages infrastructure: no cold starts, nothing to scale, nothing to patch, with a documented path to Durable Objects if write concurrency ever demands it
- UUID primary keys for distributed ID generation, E.164 phone normalization, and
ExternalId-based cross-source deduplication throughout
Google Calendar Integration
- Integrated Google Calendar v3 via service account with KV-backed token caching (55-min TTL), reducing live OAuth calls by ~98% under normal load
- Implemented multipart/mixed HTTP batching for Calendar writes: raw boundary construction (no library support in Workers), 50 PATCH requests per HTTP call, response parsing, and 429/500/503 retry with exponential backoff, staying within Cloudflare subrequest limits and Google rate constraints during migrations
Reliability — Workflows Backfill
- Re-architected a fragile calendar backfill that was tripping Cloudflare's subrequest cap into a Cloudflare Workflows fan-out / fan-in: one durable instance per date window, an idempotent count-based fan-in, and exactly-once finalization. Backfills now retry per window and recover from a crash without skipping or double-writing data
- Built observability for unattended automation: structured JSON logging, workflow run tables, heartbeat rows, cron failure emails, and a watchdog that catches silent never-ran failures
Booking, Invoicing & Payment Pipeline
- Built conflict-aware booking across boarding, house-sit, and walk/check-in with a server-enforced cancellation policy and tiered fees keyed to the local business day, plus automatic Google Calendar rollback on DB failure
- Implemented combined-set multi-pet pricing that keeps the quote, the charge, and the invoice in agreement, so a multi-pet stay never produces three different totals
- Designed a multi-source payment pipeline (Notion REST, Venmo CSV from R2, Gmail) normalized into idempotent events with per-source cursor commits. Gmail ingestion only trusts SPF/DKIM-verified mail. Automated past-due detection (grace periods, ambiguous-owner handling) emails the operator weekly
- Automated monthly invoicing:
pdf-lib synthesis → R2 storage → emailed delivery, with authenticated batch ZIP download (fflate, RFC 5987 filename encoding) behind ownership-verified Hono endpoints
Testing & CI/CD
- Drove server test coverage to near 100%, with Playwright end-to-end suites covering auth, booking, cancellation, calendar parsing, AI tools, and every dashboard component
- Gated by a CI pipeline that runs type generation, typecheck, ESLint, Prettier, and tests on every push, with Cloudflare auto-deploy on merge to
main and production source maps
02
Brad Paws AI Chat Agent
A production Claude Haiku 4.5 agent with fifteen tools, two-phase confirmation, and a circuit breaker.
Live
Clients talk to the portal in plain language. The agent runs on Claude Haiku 4.5 through Vercel AI SDK v6, with fifteen tools wired to the live system: schedule, reschedule, cancel, pull history, send a receipt. Most of the work went into the safety envelope, not the prompt. Destructive tools require two-phase confirmation. There are per-user rate limits, per-conversation token budgets, hard USD cost caps at the user and global level, and a circuit breaker that takes the agent offline when upstream errors spike. I threat-modeled the agent's surfaces (prompt injection, tool authority, data exfiltration) and shipped a mitigation for each before it touched live billing data.
Claude Haiku 4.5Vercel AI SDK v6TypeScriptHonoCloudflare Workers
15 toolslive system access
2-phaseconfirm on mutations
USD-cappedhard limits per user & global
Circuit breakerfails safe on errors
Agent & Safety Envelope
- Built the chat agent (Claude Haiku 4.5, Vercel AI SDK v6, 15 tools) with streaming responses over all booking, cancellation, and account services. Every mutation goes through an explicit confirmation card backed by a single-use KV token (5-min TTL), so no destructive action runs without approval
- Implemented layered cost controls: per-user rate limiting (20 msg/hour), daily token budgets (50k tokens/day), hard USD spend caps at the user and global level, and a circuit breaker (3 failures → 60s cooldown) — bounding API spend while maintaining availability
- Designed chat persistence with a 20-message sliding window, automatic session rotation at 100 messages, and a 90-day retention cleanup cron
- Threat-modeled the agent's attack surface (prompt injection, tool authority, data exfiltration) and shipped a mitigation for each before wiring it to live billing and scheduling data
Why it matters: a chat agent in front of a live billing and scheduling system is a liability without guardrails. I put the circuit breaker at the agent layer rather than the model layer, so it still protects the downstream tools when the model itself is the thing misbehaving.
03
Brad Paws MCP Server
A standards-compliant Model Context Protocol server with OAuth2 + PKCE, stateless on Workers V8.
Spec-strict
I exposed the Brad Paws platform to MCP clients so I (and authorized agents) can drive the system from Claude Desktop, Cursor, or anything spec-compliant. The server implements the MCP spec and handles OAuth2 with PKCE for client auth. It's stateless across the Workers V8 fleet: every request stands alone, every token is verified, nothing held in memory between calls. This is the one where I read the spec end to end, twice.
MCP specOAuth2PKCE (RFC 7636)HonoCloudflare Workers
RFC 7636PKCE from scratch
Statelessacross V8 fleet
15 toolssingle source of truth
MCP Booking Server
- Built the MCP booking server (
@modelcontextprotocol/sdk v1.x, Streamable HTTP) so external AI agents (Claude Desktop) can manage bookings through 15 shared tool definitions
- Aligned MCP transport with Workers' V8 isolate model: stateless per-request server instances with closure-cached tool state — no server-side sessions, no Durable Objects required
- Centralized tool definitions across the chat agent and MCP server in a single source of truth (names, Zod schemas, MCP annotations), eliminating behavioral drift between access channels
Authentication & Security
- Built a full OAuth 2.1 authorization-code flow with PKCE (RFC 7636) from scratch — dynamic client registration, S256 code-challenge verification, single-use authorization codes, refresh-token rotation, IP-based rate limiting against brute-force enumeration, and hashed-token audit logging
- Implemented cookie-based JWT auth (HS256 via
jose) with HttpOnly/Secure/SameSite=Lax cookies, server-side session revocation, and E.164 phone normalization, protecting the client dashboard from XSS and CSRF without a third-party auth provider
- Added non-blocking D1 audit logging for all OAuth events with indexed queries by owner, action, and timestamp
04
Debrief
A native macOS app that records job-interview calls locally, transcribes them on-device, and turns them into LLM-scored coaching feedback.
Open source
Debrief records your interview calls, transcribes them on-device, and scores them against a rubric, so you walk into round two knowing what to fix. The core idea is dual-stream capture: your mic and the interviewer's audio (via ScreenCaptureKit) record as two independent tracks, so who-said-this is a hardware-level fact instead of an ML diarization guess — nothing joins the call as a visible bot. WhisperKit (CoreML/Metal) transcribes fully on-device; the Claude API then produces per-dimension scores, weakness tags, and action items. Paste a company's actual leveling guide and the model weights it above the built-in rubric for that session; an offline mode runs coaching against a local model instead. Audio flushes to disk in chunks during recording, so a crash mid-interview never loses a session, and a trends view charts recurring weakness tags across companies and rounds. Built solo as a native Swift Package with five independently testable targets, each covered by automated tests — including a real end-to-end WhisperKit integration test.
SwiftSwiftUISwift Package ManagerScreenCaptureKitWhisperKitGRDB/SQLiteClaude APIKeychain Services
On-deviceno audio leaves the machine
Dual-streamdeterministic speaker attribution, no bot
Crash-safechunked capture, automatic recovery
05
Pawservation
An open-source, embeddable multi-tenant booking widget — drop a live booking calendar into any website with a single <script> tag.
Open source
Pawservation is the productization of the Brad Paws scheduler, built solo end to end. A host site adds one <script> tag; Pawservation injects an auto-resizing iframe whose postMessage channel is validated by both origin and source, so neither the widget nor the host page can hijack the other. Behind it is a full multi-tenant platform — each sitter gets isolated config, services, pricing, and bookings, with capacity and conflict rules computed from a single source of truth, plus a non-technical dashboard for confirming bookings, defining time-windowed services, importing clients from CSV, and syncing to Google Calendar. The booking/date/pricing core is pure TypeScript with zero runtime dependencies, so the rules that decide what a customer can book are testable in isolation — and tested against in-memory SQLite. CI gates every PR on typecheck, lint, format, test, and build, then auto-deploys to Cloudflare on merge.
TypeScriptReactHonoCloudflare WorkersD1KVViteVitestGitHub Actions
Multi-tenantisolated config, pricing, and capacity per tenant
Safe embeddingorigin- and source-validated postMessage
Dependency-free corebooking rules testable in isolation
06
MCP Auth Kit
A production-minded MCP server kit: OAuth 2.1 + PKCE, rate limiting, scope-gated tools, and two-phase confirmation.
Open source
MCP Auth Kit packages the hard parts of shipping a safe Model Context Protocol server so others don't rebuild them from scratch. It handles OAuth 2.1 with PKCE, rate limiting, scope-gated tool access, and two-phase confirmation on sensitive actions, and stays unopinionated about your tools, identity provider, and storage. It's the reusable, open-source distillation of the auth and safety work behind the Brad Paws MCP server.
TypeScriptMCPOAuth 2.1PKCERate limitingScope-gated auth
OAuth 2.1 + PKCEagent auth done to spec
Scope-gated toolsevery call authorized against explicit scopes
Two-phase confirmsensitive actions propose first, execute on approval
07
Roadrunner
A multi-user Django app that shares the nature you saw on your Strava activities — matching eBird and iNaturalist observations by time and location.
Open source
Log in with Strava, link an eBird or iNaturalist profile, and Roadrunner writes the species you logged into the description of the matching Strava activity. Activities sync in real time via Strava OAuth and webhooks, with automatic token refresh. The interesting problem: birders submit checklists hours after they get home, so unmatched activities go into a deferred re-check queue (2/4/8-hour ladder), and the species appear the moment the checklist does. Deployed serverless on Vercel with pooled Neon Postgres and scheduled by a bearer-authenticated GitHub Actions cron. Three third-party API integrations, timezone-correct wall-clock matching, security middleware (CSRF, clickjacking, per-user webhook rate limiting), and a test suite covering matching, sync, OAuth, and the re-check queue.
PythonDjangoPostgreSQL (Neon)VercelStrava APIeBird APIiNaturalist APIGitHub Actions
3 APIsStrava, eBird, iNaturalist
2/4/8hdeferred re-check ladder
Real-timeOAuth + webhook sync