You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Idempotency keys on MCP write tools so a retried call does not write twice #407
area: mcpThe MCP server, its tools and its OAuthenhancementA new capability or an improvement to an existing onep2 mediumWorth doing, not urgentpoints: 5Fibonacci estimate: 5schema changeAdds, drops or alters a table. Migrations are applied by hand before the code shipssize: mediumA day or two. One surface, no new modelstaleNo activity for a long timework in progressNot ready for review yet
Implementation is open in #455, with changes requested because an expired idempotency lease can repeat an already committed write. Keep this open until that retry case is fixed and tested.
Original requirements
The annotation work in #384 exposed that several write tools are honestly not idempotent: update_doc, move_doc and edit_doc_comment assign a fresh sync id and publish another update on every call, and add_comment or create_issue retried after a timeout produce a duplicate. Agents retry. That is the whole reason the hints exist.
What to build
Accept an optional idempotencyKey argument on every write tool. Scope it to the grant.
Store (grant, key, tool, response hash, response) with a short retention, a day is plenty.
A repeated call with the same key and same arguments returns the stored response and performs nothing. Same key with different arguments is refused with a clear error.
Document it in docs/mcp.md and in the tool descriptions so a client knows to send one.
Tests
Two create_issue calls with one key create one issue. A retried add_comment posts once. A key reused with different arguments is refused. A key from another grant is a different key.
The table is small and the change touches packages/mcp-server/src/tools/support.ts once, so this is a good self-contained piece for someone who wants to learn the MCP layer.
This issue has had no activity for 60 days, so it is being marked stale.
If it still matters, say so and it stays open. Adding what you have
learned since filing it helps more than a bump on its own. Otherwise it
will close in 14 days, and closing is not a judgement, it just keeps the
list honest about what is actually being worked on. Reopening is always
fine.
area: mcpThe MCP server, its tools and its OAuthenhancementA new capability or an improvement to an existing onep2 mediumWorth doing, not urgentpoints: 5Fibonacci estimate: 5schema changeAdds, drops or alters a table. Migrations are applied by hand before the code shipssize: mediumA day or two. One surface, no new modelstaleNo activity for a long timework in progressNot ready for review yet
Activity
github-actions commentedon Nov 22, 2026
This issue has had no activity for 60 days, so it is being marked stale.
If it still matters, say so and it stays open. Adding what you have
learned since filing it helps more than a bump on its own. Otherwise it
will close in 14 days, and closing is not a judgement, it just keeps the
list honest about what is actually being worked on. Reopening is always
fine.