Architecture notes: multi-tenant encrypted MCP memory on Cloudflare Workers + D1 + Vectorize

ELYRAON · reddit · 2026-12-05

The author shares a production architecture for persistent MCP memory with strict tenant isolation on Cloudflare's edge stack: Workers handle MCP tool calls with per-tenant auth middleware; D1 stores manifests, tenant keys and encryption metadata so unauthorized queries fail before touching embeddings; Vectorize is partitioned strictly by tenant namespace with deterministic gate checks on every read/write path. The key trade-off: keeping cold-start latency low while running full tenant isolation and payload encryption means a tiny Worker bundle and no heavy runtime crypto wrappers. He asks whether others isolate at the index level or spin up separate Workers per workspace.

Original post →

More from coding & agent

coding & agent channel →