cd /news/ai-agents/my-mcp-retry-proxy-passed-a-digest-c… · home › topics › ai-agents › article
[ARTICLE · art-177902] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

My MCP retry proxy passed a digest check and still wrote a duplicate row

A developer built an MCP HTTP retry proxy, epistemic-guard, that deduplicates mutating tool calls using caller-supplied operation keys, Ed25519-signed receipts and an append-only log, and tested it against the zambodotdev lost-response-test-contract. An initial delayed-retry run passed a digest check but still wrote a duplicate row, because log rotation verified the previous log's hash chain without seeding its operation keys and receipt ids into the index; version 0.6.5 fixed this by seeding both indexes on rotation, and a retest about 27 hours after planting a fresh operation kept the effect count at 1 across identical and changed-argument retries.

recommendation

When rotating an idempotency receipt log, seed both the key and receipt-id indexes from the previous log and add a delayed-retry regression test that counts effects, not just digests.

more in playbook: Securing agents and AI tools
by read3 min views4 publishedNov 28, 2026

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.

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: -32602. Receipts are Ed25519-signed and chained in an append-only log. GET /receipts/<key> returns the recorded outcome and its digest.

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.

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.

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.

── more in #ai-agents 4 stories · sorted by recency
── more on @epistemic-guard 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/my-mcp-retry-proxy-p…] indexed:0 read:3min 2026-11-28 · —