An agent calls a mutating MCP tool. The server commits the write, and the HTTP response is lost on the way back. The client retries with a new JSON-RPC id, the server cannot tell it is the same operation, and now there are two tickets.
I wrote a proxy meant to stop the second write and ran it against a lost-response contract that someone else wrote and scores. On the delayed leg I scored my own run a pass. The contract owner did not accept it as a full pass, and the check he asked for showed my proxy writing twice.
Scope first: one clean delayed run, on a local proxy on 127.0.0.1, against a synthetic server, with my own tool. Not a benchmark.
How the proxy works
The proxy (epistemic-guard mcp-http-proxy) sits between the client and an unmodified server. It only acts on calls that carry an operation key: an Idempotency-Key style header, or an operation_key in params._meta. The proxy never mints a key: the caller has to send one and keep it. A call without a key is not deduplicated.
For a keyed call, the proxy hashes the tool name and arguments and looks the key up in its receipt log:
- New key: forwarded, result recorded.
- Same key, same arguments: the original result is replayed without touching the server.
- Same key, different arguments: refused with HTTP 409 and JSON-RPC
-32602.
Receipts are Ed25519-signed and chained in an append-only log. GET /receipts/<key> returns the recorded outcome and its digest.
The test
The contract is zambodotdev/lost-response-test-contract. Its rules and scoring are the owner's. I ran every leg myself, on my own machine, against a deliberately naive server: a small Streamable HTTP MCP server backed by SQLite, with no idempotency of its own. Effects are counted from the SQLite table directly, not from anything the proxy reports.
Without the proxy, the retry executed again. The identical-retry check (A1) ended with an effect count of 2, and the changed-argument retry (A2) also ran as a new call, count 1 to 2 (runs/2026-11-20-epistemic-guard-unwrapped-control/summary.json).
Behind the proxy, A1 and A2 ended at a count of 1, the changed-argument retry was refused, and a lookup by key alone (A3) returned the digest committed at write time.
A digest match is not a count
The delayed check (A5) plants an operation, waits more than a day, restarts the proxy from its persisted receipt log, then retries and recounts.
My first delayed run only did the lookups. The digest matched, and I scored it a pass. The owner's answer: retry protection was unproven until I ran the delayed retries and counted effects before and after.
The first delayed retry inserted a duplicate row. Count 1 to 2.
When the proxy rotated its receipt log, it checked the hash chain of the previous log but did not load that log's operation keys and receipt ids into its index. The record was intact and the lookup was correct, and the retry still missed the cache. A digest match alone would have passed a proxy that wrote twice.
I fixed it in version 0.6.5 (seed both indexes from the previous log on rotation), added a regression test, and left the failed run on the public record, labelled as a fail that was fixed on retest.
Then I planted a fresh operation on the fixed build. The owner recorded its key, receipt id and digest on his side at plant time. About 27 hours later, the lookup by key alone returned HTTP 200 and the committed digest. The effect count was 1 before the retries and 1 after. An identical retry replayed the original, and a changed-argument retry was refused. I ran that delayed leg twice that night, nine minutes apart, on two builds that both contain the fix (a455aec, then 732c551); the file on record is the second run, same plant, same digest. The owner checked the committed files against the digest he had recorded and merged the adapter and the run records into the contract repo.
Limits
- One clean delayed run, on a local proxy on 127.0.0.1, against a synthetic server, with my own tool. Not a benchmark, and not a claim about hosted endpoints.
- I ran every leg. The owner verified committed files and a recorded digest. As far as the record shows, he did not run the proxy.
- No key, no deduplication. The key also has to survive on the client side: if it is lost with the client process, the proxy sees a new operation.
- The receipt is written after the server's response comes back. If the proxy itself dies after the server commits and before the receipt is written, a retry has nothing to find and executes again. I have not tested that window.
- The proxy is multi-threaded and I found no lock that holds a second call with the same key while the first is still in flight upstream. I have not tested that race either.
- This is the wire half. After a refusal or an error flag, a model can still tell the user the work was done. I wrote about that half, with its false alarms, in my earlier post on 60 live MCP failures.
Try it, and what I would like back
The adapter, the fixture server and the recorded runs are in the contract repo (the runs/ folders and the adapter review file there). The proxy is in epistemic-guard (MIT, pip install epistemic-guard; the rotation fix is in 0.6.5 and later).
If you run a retry proxy of your own, I would like to see it scored against the same contract, with effects counted before and after the retry.