billflare.

Removing unneeded Durable Objects from MCP servers on Workers

Justin (@interjc) describes moving read-only MCP servers from McpAgent, which starts a Durable Object per session, to stateless createMcpHandler, and shares a prompt for auditing Workers bindings and runaway usage patterns.

Products
WorkersDurable Objects
Source
Author experience𝕏
Author
Justin (@interjc)

Key points

  • The author found several MCP servers on an early template using McpAgent, which starts a Durable Object per session even though his tools are read-only. He upgraded the MCP SDK to 2.0, switched to stateless createMcpHandler, retired the old SSE transport, removed the DO binding and added a deleted_classes migration.
  • He also disabled workers.dev and preview URLs, kept only the custom domain, and added an Origin allowlist and request timeouts, so billing is left to requests and CPU time.
  • His audit prompt asks an agent to list every binding and trigger in the wrangler config, flag unused defaults, look for per-request DO creation, self-renewing setAlarm, Worker–DO call loops, unbounded retries, long connections without Hibernation and uncapped pagination, and report before changing or deploying anything.

Original sources

  1. Original post

    Read on 𝕏

    Justin

    @interjc · Original 𝕏 post

    如果你是 Cloudflare Workers Paid 用户,就得防着网络攻击或死循环代码打爆账单。最近就有老哥因为低端模型写的草台代码,产生了一万多美金的 DO 消费 看到这事我赶紧翻了下自己的项目,发现几个 MCP Server 还是早期模板的写法,用的是 McpAgent,每个会话都会起一个 Durable… pic.twitter.com/eTIUfje660
Author experienceWorkers +4

After a $10,000 loop bill: budget alerts and a cost-audit prompt for vibe-coded projects

铁柱AGI (@cgnot996) writes an X article that walks through creating a Cloudflare budget alert, explains why it is only a notice, lists cost-amplifying code patterns, and gives a read-only audit prompt and steps for when a bill has already spiked.

Durable Objects

Steven Menke: an Agents SDK bug and a reported $1,700 Durable Objects invoice.

Steven Menke (@Galorious_) reports that runaway Durable Objects caused by an Agents SDK bug produced a $1,700 invoice in three days, citing one trillion SQLite reads (a later post says writes). He says his support ticket, even after a maintainer escalated it, received no reply for months.

Containers

Containers: an author asks Cloudflare to void a $161.11 memory charge.

Hacker News user alexander2002 asks Cloudflare support to void a $161.11 Container Memory charge, saying he usually pays Cloudflare around $30 and this was a sudden jump. He later says he already tried the official support route and X.