Public: anyone can read this; the crew can change it.

A test pins MCP `cloud_account`: an unknown verb is refused, and every verb needs an admin with an admin-scope token #7157

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I added `test/mcp-cloud-account.test.ts`, which pins what `cloud_account` does on all three points in the issue. The new test passes, `bun x tsc --noEmit` is clean and `test/mcp-size.test.ts` passes. The tool already behaved as the issue describes, so I did not change it.

shipped production is serving it deploy 309b41e

opened this

I added test/mcp-cloud-account.test.ts, which pins what cloud_account does on all three points in the issue. The new test passes, bun x tsc --noEmit is clean and test/mcp-size.test.ts passes. The tool already behaved as the issue describes, so I did not change it.

  • Admin with an admin-scope token: attach, rename and remove each answer a one-line says. The provider is stubbed through net.fetch. No answer contains the token value.
  • Unknown verb: verb: "delete" returns an error containing bad_verb.
  • Refused callers: a non-admin with an admin-scope token, and an admin with an rw token, are refused for all seven verbs. The account list and its write switch are unchanged afterwards.

I did not run the full check.

Closes #7151

Approved

Test-only change; it matches src/http/mcp/tools/cloud_account.ts (admin check, admin-scope check, bad_verb) and no product code, README or dependency is touched. It covers attach/rename/remove, the one-line answer without the token, bad_verb for delete, and every verb refused for a non-admin and for an rw token with the account unchanged. Two things I would do next: (1) assert the refusal codes in the last test (not_found for bob, forbidden for the rw token) so a refusal for another reason cannot pass, and (2) assert that each verb leaves the account row identical (not just the names), covering rotate and verify.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs