mcp: take send_draft's confirmation from the toolkit

Merged
JE
2d ago
+88-173

The confirmation's primitives were the same design here and in the hosted
HEY MCP server, whose copy was the superset, and they now live once in
github.com/basecamp/mcp/confirm: the signed state and its keys, the form
and its answer, which clients can be asked, the tools/list filter, and the
per-process claims. send_draft keeps what is its own: the order of its
checks, its refusals and their wording, the draft's fingerprint, and the
prompt.

What changes on the wire is the request state's shape: the toolkit's
fields and a key id. A key still lives only as long as the process, so no
state of the old shape outlives a build. send_draft binds the draft id as
the argument hash, the HEY origin as the identity and the sign-in as the
grant; the fingerprint rides as the digest and is compared on its own, so
a changed draft is still told apart from a different one. A confirmation
is now refused after its expiry second rather than at it, and a claim is
also forgotten by a timer at 24 hours, not only when the next send sweeps.

Pins github.com/basecamp/mcp to v0.0.0-20261119020105-1a6d02c5380a; the
Nix vendorHash follows go.sum.


Summary by cubic

Adopts the shared confirmation toolkit from github.com/basecamp/mcp/confirm for send_draft, replacing the duplicated confirmation primitives (signed state, keys, form elicitation, claims, and client capability checks) with the toolkit's implementations.

  • The request state shape on the wire changes to the toolkit's fields plus a key id; old-shape state never outlives a process because keys are still ephemeral.
  • The draft id binds as the argument hash, the HEY origin as the identity, and the sign-in as the grant; the fingerprint rides as the digest and is still compared separately.
  • A confirmation is now refused after its expiry second rather than at it, and claims are forgotten by a 24-hour timer instead of only on the next send sweep.
  • Pins github.com/basecamp/mcp to v0.0.0-20261119020105-1a6d02c5380a; the Nix vendorHash follows go.sum.

Refactors

  • send_draft keeps its own check order, refusal wording, draft fingerprint, and prompt; the toolkit supplies the signed state, keys, form and answer, tools/list filter, and per-process claims.