Look

Auto follows your local time: Aurora by day, Neural in the evening, Terminal after midnight.

Selected work 4 of 5

Shiji 食记

A private food journal Claude can write to—remote MCP server and OAuth 2.1 on Cloudflare’s free tier

Personal project Personal project2026built with Claude Code

Results

Claude on my phone logs meals, looks at photos, estimates nutrition and writes weekly reviews into my own journal app—through a remote MCP server and OAuth 2.1 that I built on Cloudflare Workers.

  • 19

    MCP tools Claude can call

    Source: Project source: the MCP tool list

  • ~6×

    smaller bundle than with the official MCP SDK (measured at v0.2)

    Source: Project log: 1.7 MB with the SDK vs 278 KB without, measured at v0.2

  • < 1 ms

    CPU per MCP request, under the free plan’s 10 ms limit

    Source: Project log: measured at v0.2; the free plan allows 10 ms per request

  • 104

    cross-account isolation checks

    Source: Project test suite: multi-user isolation tests

01

Problem

Logging meals is tedious, and nutrition apps don’t talk to the assistant I already use. I wanted to tell Claude what I ate—on my phone, with my computer off—and have it land in a private journal with photos, estimates and weekly summaries.

02

How it works

  1. One Worker, three stores

    A single Cloudflare Worker serves the app, the API and /mcp. D1 holds rows scoped by user_id, R2 holds photos under per-user prefixes, and KV holds OAuth grants as hashes.

  2. OAuth 2.1 for a claude.ai connector

    Claude registers through dynamic client registration or a Client ID Metadata Document; the user signs in and approves on a consent page, and the grant is bound to that user. Metadata fetches are restricted to the public internet to prevent SSRF.

  3. Tools shaped for how models call them

    19 tools with safety annotations, null-tolerant optional arguments, validation errors returned as tool results rather than protocol errors, and server instructions that spell out workflows: log, then estimate; look at the photo before estimating; confirm before deleting.

  4. No model calls on the server

    The Worker never calls a model. Estimates, health scores and weekly reports come from the user’s own Claude through the tools, so the app has no API keys and no inference bill.

Everything runs inside one Worker on Cloudflare’s free tier. Claude app (phone · web · desktop) to OAuth 2.1 · DCR · CIMD · PKCE; OAuth 2.1 · DCR · CIMD · PKCE to Worker · /api · /mcp (19 tools); Journal web app to Worker · /api · /mcp (19 tools); Worker · /api · /mcp (19 tools) to D1 · rows by user_id; Worker · /api · /mcp (19 tools) to R2 · photos; OAuth 2.1 · DCR · CIMD · PKCE to KV · hashed grants. Everything runs inside one Worker on Cloudflare’s free tier. Claude app (phone · web · desktop) to OAuth 2.1 · DCR · CIMD · PKCE; OAuth 2.1 · DCR · CIMD · PKCE to Worker · /api · /mcp (19 tools); Journal web app to Worker · /api · /mcp (19 tools); Worker · /api · /mcp (19 tools) to D1 · rows by user_id; Worker · /api · /mcp (19 tools) to R2 · photos; OAuth 2.1 · DCR · CIMD · PKCE to KV · hashed grants.
Schematic Everything runs inside one Worker on Cloudflare’s free tier.
  1. User

    Lunch: beef noodle soup, about $15.

    1. log_entry { meal: "lunch", dish: "beef noodle soup", price: 15 }
    2. set_estimate { kcal: 720, protein_g: 32, confidence: "medium" }
    3. get_day { date: "today" }
  2. Claude

    Logged. You’re at 1,150 kcal and 50 g of protein today—add eggs or milk at dinner to close the gap.

Illustration Illustration of a connector conversation (demo data).

03

Decisions worth explaining

Hand-written MCP instead of the SDK

The official SDK pushed the Worker bundle to about 1.7 MB, and the first request after a cold start cost 20+ ms of CPU—over the free plan’s 10 ms. A small, stateless Streamable-HTTP JSON-RPC implementation made the bundle about 6× smaller and runs in under 1 ms per request (measured at v0.2).

Revocation that actually revokes

“Log out everywhere” also revokes Claude connector grants and open upload links, so a stolen cookie can’t become a six-month token that survives logout.

Built in a day, tested like it matters

Versions 0.1 to 0.7 shipped in a single day with Claude Code as pair programmer, backed by 289 automated checks—API smoke tests, OAuth/MCP connector, multi-user isolation and sign-in—plus a 35-step headless browser walkthrough.

04

Stack

  • Cloudflare Workers
  • D1
  • R2
  • KV
  • OAuth 2.1
  • MCP (Streamable HTTP)
  • Google OpenID Connect
  • Web Crypto
  • Vanilla JS PWA

Personal project

Private and invite-only, because it holds personal health data—happy to demo it.