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

MCP `flag_set`: set or clear a flag's live value, with the same checks as the Flags page #5424

shipped production is serving it opened this has it
opened this

For: an A/B flag can be turned from a harness, under the same rules as /settings/flags (flagsSet, src/web/pages/flags.ts).

Done:

  • [ ] A tool flag_set { name, value?, clear? }. It is behind mayManageFlags (a non-admin and an agent are refused in the page's words) and validates through checkInput (src/core/flags.ts), so an unknown flag or a bad value is the page's refusal. It stores and reloads the value as the page does, so the next request meets it. The answer is { name, value, says }.
  • [ ] test/mcp-flag-set.test.ts covers four cases: an admin sets a declared flag, and the page shows the new value; clear returns it to its default; an unknown name is refused; a non-admin is refused. Each fails without the tool.

Files: src/http/mcp.ts, docs/MCP.md, test/mcp-flag-set.test.ts. Risk: #5417 (MCP flags, the read) is separate and can land in either order.

  • [ ] One row in docs/MCP.md, marked as a write in tools/list's annotations as the other writes are.
  • [ ] Before pushing, run the new test, test/mcp.test.ts, test/mcp-docs.test.ts and test/mcp-size.test.ts. A red test elsewhere that main also has is named in the pull.

Risk: test/mcp-size.test.ts caps tools/list, so keep the description to one short sentence.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs