MCP Elicitation can delete data after a user declines
A local test of MCP Elicitation found that a naive deletion tool ignored decline and cancel responses, removed the note and reported success without raising an error. A corrected implementation checked both answer.action and the explicit confirmation field, while the SDK rejected accepted responses that violated the requested schema. The tests also found that form and URL elicitation require separate capabilities, with an empty elicitation object treated as form support through backward compatibility.
The report shows that receiving a syntactically valid MCP response is not enough: servers must interpret the response action before performing irreversible actions, and should not rely on schema validation as a substitute for consent checks.
上一篇写 Sampling,结尾我把反向通信的三条线收在一起:进度通知是 notification,绑请求;Sampling 和 Elicitation 是 request,绑会话。当时我说这条线"齐了",其实撒了谎——Elicitation 我只提了个名字,一次都没实测过。
补上之后,我发现它比 Sampling 更危险。Sampling 的失败是"借不到模型",你能看见——请求发不出去,报超时,数据没动。Elicitation 的失败是用户明明点了拒绝,数据照样被删,工具还回报"已删除"成功。整个过程没有一个报错,日志里甚至写着"确认成功"。
这篇就把 Elicitation 实测一遍。它叫"引出输入",说白了就是工具执行到一半,回头弹个表单问用户一句——"确定删除吗?""选哪个标签?""填个理由?"。听着是很干净的一层保护。
保护是不是真的,得看你拿到答案之后干了什么。
Elicitation 长什么样
服务端在一个工具 handler 里,执行到一半调 elicitInput():