My friend Jordan built a diet tracker where he tells Claude what he ate and Claude writes it to a Google Sheet. I’d quit MyFitnessPal after about a year of typing in every meal, so I wanted something I could just talk to. I’d never built an MCP before, so I built one: a Cloudflare Worker that looks up foods in USDA FoodData Central and Open Food Facts and saves my logs to D1.
Then I turned it into a template so you can run your own copy.
Then say something like “I had oatmeal with blueberries for breakfast” and it’s logged.
How it works
The MCP server runs on a Cloudflare Worker. Claude calls it to search foods and save logs, and the Worker stores your logs in D1.
Things I learned
Approximate data is fine — I spent about half a day architecting around FatSecret, which needs a dedicated IP address and only lets you cache its data for 24 hours. Then I realized USDA FoodData Central and Open Food Facts were plenty, and better for running reports across many days.
MCP clients send JSON but expect text back — that surprised me, since this was my first MCP.