Run a side effect exactly once under retries, redelivery, and concurrent workers.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Run any side effect exactly once β even when 1,000 callers demand it at the same instant.

That's not a mock β it's a live attack you can run right now:
Networks retry. Users double-click. Queues redeliver. AI agents re-fire tools at machine speed. Any of these turns one payment into two, one email into three, one server into two hundred.
Most teams hand-roll an idempotency table β and most of those are quietly broken under concurrent load: two identical requests both pass the "already done?" check, then both execute. The bugs are subtle, the failures are money.
once is that table done right, once, for everyone β a tiny idempotency kernel with the four defenses hand-rolled versions miss:
IdempotencyConflict, never someone else's cached answer.One box, several processes, no database server β SQLite, nothing to install:
Survives restarts and works across processes (WAL mode). The default MemoryStore does neither β it is per-process, so the moment you run a second worker each one keeps its own private idea of what already ran, and the guard silently stops guarding.
Several machines β share state through the Postgres you already run:
Async (FastAPI, agents) β sync side effects go to a worker thread, waiters park on the event loop (no thread-pool starvation under duplicate storms; there's a test that proves it):
| If this happens | You get |
|---|---|
| Same key + same payload, again | The stored result β no second execution |
| Same key + different payload | IdempotencyConflict β never a silent wrong answer |
| 1,000 concurrent first requests | One executor; everyone else coalesces (wait=True) or is told to wait |
| Executing worker dies | Lease expires β another caller takes over |
| "Dead" worker wakes up late | Fenced out β cannot complete, cannot fail, cannot corrupt |
| Long job outliving its lease | heartbeat() keeps it protected |
| Your function raises | Key freed β a later retry may execute |
The honest model (put this on a poster): exactly-once execution + at-least-once result delivery. True network exactly-once is physically impossible β libraries claiming it are lying to you. We execute once and re-deliver the answer as many times as asked.
Because it does. Every claim above is enforced by the chaos suite β barrier-forced thread storms, dead-lease reclaim stampedes, zombie-writer fencing, frozen-clock timeout attacks, event-loop-starvation detection β run against both the in-memory store and real PostgreSQL on every commit (CI fails loudly if the Postgres bench is skipped). Silence in CI never means "untested."
And we run it on our own production mailer β a double-approved send replays instead of double-emailing a real prospect. Dogfood first.
EffectFence (cargo add effectfence) is the Rust half of the same idea: a causal fence for tool side effects, with content-addressed certificates and an MCP proxy mode β effectfence wrap -- <any mcp server> fences another server's tool calls with zero code change (proven against once-mcp).
Use once when the side effect is Python and you want a durable store; use EffectFence when the fence lives in Rust or in front of an MCP server.
Free and Apache-2.0, and staying that way. If you want help applying it to a codebase that already moves money β side-effecting paths inventoried, storm-tested, fenced, with a CI test that keeps them fenced β email hello@aurumflux.co. Details: the Fence Audit.
Apache-2.0
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/once)<a href="https://allmcps.com/mcp/once"><img src="https://allmcps.com/api/badge/once?style=directory" alt="Once on AllMCPs" /></a>