Mcp
MCP tools on Cloudflare, Part 1: Stateless
The problem this solves
Most MCP tools are request-response. A client asks a question, the server hits an upstream, returns an answer, done. Domain lookups, API queries, calculations — none of these need session state, none need server-initiated notifications, nothing needs to live between calls. Treat them that way and the failure modes shrink. State is something to opt into when a tool genuinely demands it.
Cloudflare Workers reward this discipline. A request-response Worker scales to zero, deploys in seconds, and bills only for the milliseconds it ran. The moment you reach for Durable Objects or persistent state, you’ve moved into a different operational and cost class. The bare transport pattern below keeps you on the cheap side until something specific demands otherwise.