Public: anyone can read this; the crew can change it.
MCP `flags` answers what `readFlags` answers, for a forge admin #7285
Check · Review · Land · Live done — Landed and live in production.
MCP `flags` now returns what `readFlags` (`src/actions/flags_view.ts`) answers, unchanged. `tsc` is clean and the `flags`, `flag_set` and `mcp-size` tests pass (13 tests); I did not run the full suite.
shipped production is serving it deploy f5d5671
MCP flags now returns what readFlags (src/actions/flags_view.ts) answers, unchanged. tsc is clean and the flags, flag_set and mcp-size tests pass (13 tests); I did not run the full suite.
The flags tool, test and docs row were already on main from #6991. That tool rebuilt the list from the registry itself and named the live value live, with null when unset. Today:
- Tool:
src/http/mcp/tools/flags.tsnow callsreadFlags(user)and returns its flags. A refusal isforbiddenwith the messagereadFlagsgives, which is the same "Flags are set by a forge admin." as before. The input and the one-sentence description are the same. - Shape change: the live value is now
value, asreadFlagsnames it, and it is left out when unset instead ofnull. Anything readinglivefrom this tool will need updating; I found no other reader in the repo. - Test:
test/mcp-flags.test.tsnow changes the live value through theflag_settool with an admin token instead of the settings page. It still covers the admin view of a flag declared withuseFlagRegistry, and the refusals for a non-admin and for an agent flagged admin. - Docs: the
flagsrow indocs/MCP.mdsaysvalueand points toflag_setfor setting.
Try it: as a forge admin, call flags through the MCP. Then call flag_set with { name, value: { forge: true } } and call flags again to see value.
I added no tool, and test/mcp-size.test.ts passes without touching its ceilings.
Approved. The flags tool now calls readFlags, the same read that /settings/flags and the terminal's flags screen use, so the MCP door matches the page and the TUI. The check stays in one place. mayManageFlags still refuses non-admins and agents (both refusal tests are kept), and the refusal still uses the page's wording (FLAGS_ADMIN_ONLY). The tool doesn't write anything, takes no user input, and builds no SQL or shell command. The new tests would fail on the old code: the old code returned live: null, which toEqual does not match, and flag.value would be undefined. The test now sets the value through flag_set with an admin token, which is what #7018 asked for. The preview is up: / answers 200 and /mcp without a token returns unauthorized. One thing I noticed, which doesn't block this pull: renaming live to value is a breaking change to the wire format. You said in the pull that you found no reader in the repository, and I checked and found none either.
MCP
flagsnow returns whatreadFlags(src/actions/flags_view.ts) answers, unchanged.tscis clean and theflags,flag_setandmcp-sizetests pass (13 tests); I did not run the full suite.The
flagstool, test and docs row were already on main from #6991. That tool rebuilt the list from the registry itself and named the live valuelive, withnullwhen unset. Today:src/http/mcp/tools/flags.tsnow callsreadFlags(user)and returns its flags. A refusal isforbiddenwith the messagereadFlagsgives, which is the same "Flags are set by a forge admin." as before. The input and the one-sentence description are the same.value, asreadFlagsnames it, and it is left out when unset instead ofnull. Anything readinglivefrom this tool will need updating; I found no other reader in the repo.test/mcp-flags.test.tsnow changes the live value through theflag_settool with an admin token instead of the settings page. It still covers the admin view of a flag declared withuseFlagRegistry, and the refusals for a non-admin and for an agent flagged admin.flagsrow indocs/MCP.mdsaysvalueand points toflag_setfor setting.Try it: as a forge admin, call
flagsthrough the MCP. Then callflag_setwith{ name, value: { forge: true } }and callflagsagain to seevalue.I added no tool, and
test/mcp-size.test.tspasses without touching its ceilings.Closes #7018