Deploy Stateless MCP 2026-07-28 on Hono + Cloudflare Workers with Write-Replay Idempotency & 20M Log-Cap Sampling
Deploy Stateless MCP 2026-07-28 on Hono + Cloudflare Workers with OpenAI Responses API write-replay idempotency and Dec 1, 2026 20M log-cap smart sampling.
Scan Your Website AI-Readiness Inline (0β100)
Enter your domain to inspect live /llms.txt, ACP/UCP & MCP 2026-07-28 blockers right here on this pageβand unlock your compiled 7-file bundle + git apply .patch in 1 click.
embed.js)
β Zero CWV / SEO speed impact
β Works on Shopify, WordPress, Webflow & Next.js
Production Route Metadata (LP28 β SpecPulse AI v3.4.0, Sprint #8)
| Metadata Field | Production Value | |
|---|---|---|
| Canonical Slug | /hono-cloudflare-workers-stateless-mcp-2026-07-28-edge | |
SEO Title (60 chars) | `Hono Cloudflare Workers Stateless MCP 2026-07-28 \ | SpecPulse` |
Meta Description (155 chars) | Deploy Stateless MCP 2026-07-28 on Hono + Cloudflare Workers with OpenAI Responses API write-replay idempotency and Dec 1, 2026 20M log-cap smart sampling. | |
| Target Keywords | hono cloudflare workers mcp server, stateless mcp 2026-07-28 cloudflare workers, mcp idempotency guard workers | |
| Release Version | https://specpulse.dev/cli.mjs & specpulse/action@v3.4 (2026-11-18) |
Edge-Native Hono + Workers Quickstart (5 Seconds β Free $0 Sandbox, Pro $29/mo or $290/yr Save 2 Months, Team $99/mo or $990/yr)
Compile your OpenAPI spec or Hono routes into a zero-session hono cloudflare workers mcp server speaking stateless mcp 2026-07-28 cloudflare workers, hardened with mcp idempotency guard workers middleware and December 1, 2026 observability log-cap protection:
curl -fsSL https://specpulse.dev/api/v1/scan?url=https://yourdomain.com
curl -fsSL https://specpulse.dev/cli.mjs -o specpulse.mjs && node specpulse.mjs ./openapi.json
Direct Self-Serve Activation & Stripe Checkout CTAs:
- Launch Free Browser & CLI Sandbox (
$0/moβ No Login, Runs In-Memory) β Generate your Hono Worker MCP bundle,wrangler.jsonc,/llms.txtv2, andard.jsonv0.91 in 5 seconds. - Activate Pro Monthly (
$29/movia Stripe Checkout) or Activate Pro Annual ($290/yrβ$24.17/moeq., 2 Months Free) β Continuous GitHub PR sync (specpulse/action@v3.4), 60-second 4-depthPOST server/discover+isError: trueedge monitoring, and hosted/llms-full.txt. - Activate Team Monthly (
$99/movia Stripe Checkout) or Activate Team Annual ($990/yrβ$82.50/moeq., 2 Months Free) β Multi-Worker gateway federation, custom domains, directional OAuth scope-drift blockers, and org RBAC. - Powered by Stripe Checkout Sessions with Stripe Link, duplicate-safe Stripe Subscription Proration, and automated 7-day (
< 5builds) Stripe Refunds.
Three Production Risks Hitting Cloudflare Workers MCP Servers in Late 2026
- Legacy Stateful SSE & Durable Object Overhead vs. Stateless MCP
2026-07-28: Protocol versions2024-11-05through2025-11-25forced Workers teams to wire Durable Objects just to trackMcp-Session-Idheaders and standaloneGETSSE streams. Revision2026-07-28of the MCP Streamable HTTP specification (SEP-2575) eliminates protocol-level sessions and standaloneGETstreams (405 Method Not Allowed), shifting to per-requestPOST /mcpwith mandatoryOriginvalidation (403 Forbidden),POST server/discover, and mirrored HTTP headers (MCP-Protocol-Version,Mcp-Method,Mcp-Name,Mcp-Param-*validated with-32020 HeaderMismatch). Using@modelcontextprotocol/hono(createMcpHonoApp) and@modelcontextprotocol/server(createMcpHandler), Hono passesc.req.rawdirectly tohandler.fetchon Cloudflare Workers with zero Node.js shims. - OpenAI Responses API Native MCP Duplicate Write Replays (Nov 16, 2026): When an OpenAI Responses API MCP tool resumes an approved
mcp_approval_request(approve: true) and continues with a hosted programmatic read in the same response turn, the client loop can dispatchwrite -> read -> writeβ executing two distinct HTTPPOST /mcpwrites carrying the identicalapproval_request_idand arguments while reporting to the user that the write ran once (OpenAI Developer Community Bug #1416736). Without edge idempotency enforcement, stateless Workers create duplicate invoices, orders, or webhooks. - Cloudflare December 1, 2026 Observability Pricing & the
20MLog-Event Cliff: Under Cloudflare Workers Logs pricing and Workers Platform Pricing, Workers Paid ($5/mo) includes20,000,000log events per month (+$0.60per additional million, 7-day retention), and beginning December 1, 2026, Free, Pro, and Business accounts transition automatically to Cloudflare Observability pricing (50 GBshared ingestion +10 GB-monthstorage on Paid;0.5 GB/dayhard stop on Free). Setting naivehead_sampling_rate: 0.1inwrangler.jsoncdrops 90% of500errors and silent JSON-RPCisError: truetool failures, whereashead_sampling_rate: 1burns2events per MCP call (1invocation log +1structuredconsole.log) and blows past20Mevents at just10Mmonthly requests.
Before vs. After: Vanilla Workers MCP vs. SpecPulse v3.4 Edge Bundle
| Edge Architecture Layer | Unhardened Hono / Legacy Workers MCP | SpecPulse v3.4 (--framework hono-workers) |
|---|---|---|
| Transport & State Cost | Stateful Durable Objects for Mcp-Session-Id + initialize | Zero-DO Stateless MCP 2026-07-28 via @modelcontextprotocol/hono ($5/mo Workers Paid) |
| Header & DNS Rebinding Security | Unchecked Origin / Host or unvalidated Mcp-Name headers | createMcpHonoApp({ allowedHosts }) 403 guard + strict -32020 HeaderMismatch validation |
| Duplicate Write Replay Guard | Executes write -> read -> write twice (OpenAI Bug #1416736) | RFC 8941 Structured String Idempotency-Key (400/409/422) + KV approval_request_id replay cache |
| Dec 1, 2026 Log-Cap Telemetry | Either 100% logging (overage bill) or blind head_sampling_rate: 0.1 (loses 90% of errors) | Differential Outcome Sampling: 10% on healthy 200 OK, 100% on 4xx/5xx & JSON-RPC isError: true |
| Agent Discovery Surface | Bare /mcp endpoint with zero domain discovery | Bundled /llms.txt v2, Lighthouse ard.json v0.91, SEP-2127 /mcp/server-card, & SKILL.md |
| OAuth 2.1 & Recon Defense | Raw .map files deployed; unverified token audiences | Cloudflare MCP OAuth 2.1 pass-through + .map & secret scrubbing (GTIG Q4 2026) |
Production Hono + Cloudflare Workers Implementation (src/index.ts & wrangler.jsonc)
SpecPulse v3.4 generates a single-file edge gateway using official MCP TypeScript SDK v2 packages (Serve with Hono β MCP TypeScript SDK), keeping the explicit c: Context type annotation required so c.get('parsedBody') compiles cleanly under strict TypeScript:
import { createMcpHonoApp } from "@modelcontextprotocol/hono";
import { createMcpHandler, McpServer } from "@modelcontextprotocol/server";
import type { Context } from "hono";
import * as z from "zod/v4";
import {
withMcpWriteIdempotencyGuard,
emitDifferentialWorkerLog,
registerDiscoveryRoutes,
} from "./generated/specpulse-edge-v34";
export interface Env {
IDEMPOTENCY_KV: KVNamespace;
ALLOWED_PUBLIC_HOST: string;
}
// 1. Stateless per-request MCP 2026-07-28 server factory (zero Durable Objects)
const mcpHandler = createMcpHandler(() => {
const server = new McpServer({ name: "acme-edge-mcp", version: "3.4.0" });
server.registerTool(
"orders_create",
{
description: "Create a customer order with strict RFC 8941 write-replay idempotency",
inputSchema: z.object({
sku: z.string(),
quantity: z.number().int().positive(),
idempotency_key: z.string().min(16),
}),
},
async ({ sku, quantity, idempotency_key }, ctx) => ({
content: [
{
type: "text",
text: JSON.stringify({ orderId: `ord_${idempotency_key.slice(0, 12)}`, sku, quantity, actor: ctx.http?.authInfo?.clientId ?? "verified" }),
},
],
})
);
return server;
});
// 2. Host & Origin DNS-rebinding protection bound to production edge hostname
const app = createMcpHonoApp({
host: "0.0.0.0",
allowedHosts: ["mcp.acme.dev"],
});
// 3. Serves /llms.txt (<=50KB), /.well-known/ard.json (v0.91), /mcp/server-card (SEP-2127), and /.well-known/skills/index.json
registerDiscoveryRoutes(app);
// 4. Stateless POST /mcp with OpenAI write-replay guard + Dec 1, 2026 10%/100% differential log sampler
app.post("/mcp", async (c: Context<{ Bindings: Env }>) => {
const startMs = Date.now();
const parsedBody = c.get("parsedBody");
const response = await withMcpWriteIdempotencyGuard(
c.req.raw,
parsedBody,
c.env.IDEMPOTENCY_KV,
() => mcpHandler.fetch(c.req.raw, { parsedBody })
);
// Logs 10% of healthy 200 OK calls, 100% of HTTP >=400 or JSON-RPC result.isError === true
c.executionCtx.waitUntil(
emitDifferentialWorkerLog(c.req.raw, response.clone(), Date.now() - startMs, {
okSampleRate: 0.10,
errorSampleRate: 1.0,
})
);
return response;
});
// Explicit 405 on standalone GET/DELETE per Stateless MCP 2026-07-28 Streamable HTTP spec
app.on(["GET", "DELETE"], "/mcp", () => new Response(null, { status: 405, headers: { Allow: "POST" } }));
export default app;
Cost-Capped wrangler.jsonc Configuration (Pre-Dec 1, 2026 Ready)
By disabling noisy duplicate automatic invocation logs (invocation_logs: false per Cloudflare Workers Logs Docs) or pairing with a Cloudflare Tail Worker, your Worker emits one structured JSON event on 10% of healthy 200 OK calls (1.5M events at 15M monthly requests) while retaining 100% of HTTP errors and isError: true upstream failures β staying comfortably inside the 20M/mo Workers Paid allowance ($0.00 overage):
{
"name": "acme-stateless-mcp-edge",
"main": "src/index.ts",
"compatibility_date": "2026-11-15",
"upload_source_maps": false,
"observability": {
"enabled": true,
"head_sampling_rate": 1,
"logs": {
"invocation_logs": false
}
},
"kv_namespaces": [
{
"binding": "IDEMPOTENCY_KV",
"id": "8f4e2c1a9b7d4e3f8a1c2b3d4e5f6a7b"
}
]
}
Note on source maps: upload_source_maps: false (plus SpecPulse's .map artifact scrubber) prevents public source-map reconnaissance flagged in the Google Cloud GTIG Q4 2026 AI Threat Tracker; enable private symbolication only in isolated staging environments.
Copy-Paste GitHub Actions Workflow (specpulse/action@v3.4)
Validate MCP contract transitions, inject RFC 8941 idempotency schemas, and run a post-deploy 4-depth Outside-In probe (POST server/discover -> GET 405 check -> tools/list SHA-256 lockfile -> synthetic tools/call asserting result.isError !== true) using least-privilege GitHub Actions permissions:
name: Compile & Probe Hono Cloudflare Workers Stateless MCP
on:
push:
branches: [main]
paths:
- "src/**/*.ts"
- "openapi.yaml"
- "wrangler.jsonc"
pull_request:
paths:
- "src/**/*.ts"
- "openapi.yaml"
permissions:
contents: read
pull-requests: write
jobs:
specpulse-edge-mcp:
runs-on: ubuntu-latest
steps:
- name: Checkout Edge Worker Repository
uses: actions/checkout@v4
- name: Setup Node.js 22
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
- name: Compile Stateless MCP 2026-07-28 + Idempotency & Log-Sampler Guards
uses: specpulse/action@v3.4
with:
framework: "hono-workers"
entry: "src/index.ts"
fqdn: "mcp.acme.dev"
inject_idempotency_rfc8941: "true"
workers_ok_log_sample_rate: "0.10"
scrub_sourcemaps_and_secrets: "true"
mcp_probe_url: "https://mcp.acme.dev/mcp"
mode: "auto-pr"
specpulse_api_key: ${{ secrets.SPECPULSE_API_KEY }}
Transparent Search & Pricing Expectations
Per the Google Search Central AI Optimization Guide, /llms.txt and /.well-known/ard.json do not alter Google Search organic rankings; they serve AI coding/API agents and Chrome Lighthouse Agentic Browsing audits.
| Plan | Price | Included Capabilities | Direct Activation CTA |
|---|---|---|---|
| Free Sandbox | $0 / mo | Instant Hono + Cloudflare Workers MCP 2026-07-28 scaffold, idempotency middleware, 10%/100% log sampler, /llms.txt & ard.json v0.91 | Run Free Sandbox (/playground) |
| Pro | $29 / mo or $290 / yr (2 months free β $24.17/mo eq.) | Up to 10 Worker repos with automatic GitHub PR sync, 60-second Outside-In POST server/discover & isError: true alerting, hosted /llms-full.txt | Checkout Pro Monthly ($29/mo) Β· Checkout Pro Annual ($290/yr) |
| Team | $99 / mo or $990 / yr (2 months free β $82.50/mo eq.) | Multi-Worker domain gateway federation, unlimited repos, custom domains, OAuth 2.1 scope-drift PR blockers, team RBAC | Checkout Team Monthly ($99/mo) Β· Checkout Team Annual ($990/yr) |
Structured Data (SoftwareApplication + FAQPage JSON-LD)
Stop Losing AI Search Buyers to Competitors β Go Live in 60 Seconds
No sales demos, zero lock-in, instant 1-click cancellation β’ Save 2 months on Annual plans (Pro $290/yr Β· Agency $2,990/yr)
<script src="https://specpulse.dev/embed.js" data-site="your-domain-com" defer></script>