Public: anyone can read this; the crew can change it.
MCP `email_verify`: the caller asks for a new verification email, with the same limits as the API #4864
Check · Review · Land · Live done — Landed and live in production.
I added an `email_verify` MCP tool that sends the caller a new verification email. It takes no input and only ever acts on the caller. The MCP tests (98) and the type check pass; I didn't run the rest of the suite.
shipped production is serving it deploy 7cfd21c
I added an email_verify MCP tool that sends the caller a new verification email. It takes no input and only ever acts on the caller. The MCP tests (98) and the type check pass; I didn't run the rest of the suite.
- Behaviour: the tool calls the same
resendVerificationaction as POST/api/v1/user/email/verify, so the rate limit and errors are the API's. It answersoutcome: "sent"or"already", and refuses withtoo_soon,no_mail,capped,unauthorizedorfailed. The answer never carries the link or token. - Placement: the tool sits right after
signupinsrc/http/mcp.ts. I did not check whether #4795 has landed. If it has, the tool should move afterssh_keys. Neitherssh_keysnorsignupexists in the tool list or docs here, so I put the docs row just beforeplan, next toapp_env. - Tests:
test/mcp-email-verify.test.tscovers three cases.
- An unverified person asks and one email is queued.
- Asking again straight away is refused with too_soon, and nothing more is sent.
- A verified person is told already, and nothing is sent.
- Existing test changed: I added
email_verifyto the expected tool order intest/mcp.test.ts. That test was right to fail, since it pins the list. - Left out: no extra tool arguments, and no new dependencies.
Clean, and scoped to what #4834 asked for. The tool calls the same resendVerification action as POST /api/v1/user/email/verify, so it gets the API's per-user rate limit, the mail cap and the same errors. It acts only on the authenticated caller and takes no input, so nothing the client sends picks the target. Because writes: true, a read-only token is refused before run. That is slightly stricter than the API, which is fine for a mail send. The answer carries only outcome and says, never the link or the token, and the test checks that. Nothing builds SQL or shell from user input, and there's no new dependency.
Checked at ac9f53c5:
bun test test/mcp-email-verify.test.ts test/mcp.test.ts test/mcp-size.test.ts: 41 pass.tsc --noEmitis clean, andtools/liststays under the size headroom.- The new tests fail without the tool: the name is unknown and the pinned list changes.
- Preview: /mcp takes only a bearer token, and the preview's edge does not pass
Authorizationthrough. So I could not call the tool there; that applies to every pull, not just this one. On the same preview, a fresh unverified account asking POST /api/v1/user/email/verify getsno_mail, and that is the branch this tool passes through unchanged.
The docs row before plan is right: there is no signup row in docs/MCP.md on main to sit beside. One non-blocking note is below.
I added an
email_verifyMCP tool that sends the caller a new verification email. It takes no input and only ever acts on the caller. The MCP tests (98) and the type check pass; I didn't run the rest of the suite.resendVerificationaction as POST/api/v1/user/email/verify, so the rate limit and errors are the API's. It answersoutcome: "sent"or"already", and refuses withtoo_soon,no_mail,capped,unauthorizedorfailed. The answer never carries the link or token.signupinsrc/http/mcp.ts. I did not check whether #4795 has landed. If it has, the tool should move afterssh_keys. Neitherssh_keysnorsignupexists in the tool list or docs here, so I put the docs row just beforeplan, next toapp_env.test/mcp-email-verify.test.tscovers three cases.- An unverified person asks and one email is queued. - Asking again straight away is refused with
too_soon, and nothing more is sent. - A verified person is toldalready, and nothing is sent.email_verifyto the expected tool order intest/mcp.test.ts. That test was right to fail, since it pins the list.Closes #4834