Context
src/mcp/server.ts follows an "MCP-first exposure mandate" — new capabilities get their own MCP tool. The maintain CLI family (packages/loopover-mcp/bin/loopover-mcp.js, runMaintainCli around line 1737) is mostly already mirrored: maintain queue/approve/reject map to loopover_list_pending_actions/loopover_decide_pending_action, and maintain status maps to loopover_get_automation_state — whose own comment (src/mcp/server.ts:2260) explicitly labels it "the read side" of the agent automation control surface.
The write side is incomplete. maintain pause/resume (loopover-mcp.js:1783) does a read-merge-write PUT /settings toggling agentPaused; maintain set-level <action> <level> (loopover-mcp.js:1789) does the same for a per-action-class autonomy level. Neither has a matching MCP tool — a full-file grep of src/mcp/server.ts for anything resembling set_automation_state/pause_agent returns nothing.
Requirements
- Add MCP tool(s) covering the same two write operations the CLI already exposes: toggling
agentPaused (pause/resume) and setting a per-action-class autonomy level, both via the repo settings route the CLI already calls.
- The new tool(s) must require the same maintainer-manage authorization the existing write-side sibling tools already enforce (e.g.
loopover_propose_action's own description: "Maintainer access required") — do not weaken or bypass the existing server-side authorization check on the settings route; this issue is exposing an already-authorized capability through a new interface, not granting a new one.
- For
set-level, reuse the read-merge-write pattern the CLI already uses (read current autonomy map, merge the one changed action-class, write back) so setting one action's level doesn't clobber the others — don't have the MCP tool require the caller to pass the full autonomy map.
- Validate the
action/level inputs against the same enums the CLI validates against (MAINTAIN_ACTION_CLASSES/MAINTAIN_AUTONOMY_LEVELS in loopover-mcp.js) — read the CLI file directly for the exact allowed values, don't guess.
- Follow this file's existing tool-registration conventions exactly (Zod input/output schemas,
this.toolResult(...) wrapping, a doc comment tagged with the relevant tracking issue number).
Deliverables
Test Coverage Requirements
99%+ patch coverage (branch-counted), including the unauthorized-caller rejection branch and the read-merge-write "other classes preserved" branch.
Expected Outcome
An MCP client with maintainer access can pause/resume agent actions and set a per-action autonomy level for a repo — the same capability loopover-mcp maintain pause|resume|set-level already provides via CLI — closing the last gap in an otherwise-fully-mirrored maintain command family.
Links & Resources
packages/loopover-mcp/bin/loopover-mcp.js:1783-1800 (pause/resume/set-level CLI implementation)
src/mcp/server.ts:2260-2271 (loopover_get_automation_state, the read-side sibling whose comment names this as the known-missing write half)
src/mcp/server.ts (loopover_propose_action, loopover_decide_pending_action — the maintainer-access-required pattern to mirror)
Context
src/mcp/server.tsfollows an "MCP-first exposure mandate" — new capabilities get their own MCP tool. ThemaintainCLI family (packages/loopover-mcp/bin/loopover-mcp.js,runMaintainCliaround line 1737) is mostly already mirrored:maintain queue/approve/rejectmap toloopover_list_pending_actions/loopover_decide_pending_action, andmaintain statusmaps toloopover_get_automation_state— whose own comment (src/mcp/server.ts:2260) explicitly labels it "the read side" of the agent automation control surface.The write side is incomplete.
maintain pause/resume(loopover-mcp.js:1783) does a read-merge-writePUT /settingstogglingagentPaused;maintain set-level <action> <level>(loopover-mcp.js:1789) does the same for a per-action-classautonomylevel. Neither has a matching MCP tool — a full-file grep ofsrc/mcp/server.tsfor anything resemblingset_automation_state/pause_agentreturns nothing.Requirements
agentPaused(pause/resume) and setting a per-action-classautonomylevel, both via the reposettingsroute the CLI already calls.loopover_propose_action's own description: "Maintainer access required") — do not weaken or bypass the existing server-side authorization check on thesettingsroute; this issue is exposing an already-authorized capability through a new interface, not granting a new one.set-level, reuse the read-merge-write pattern the CLI already uses (read currentautonomymap, merge the one changed action-class, write back) so setting one action's level doesn't clobber the others — don't have the MCP tool require the caller to pass the full autonomy map.action/levelinputs against the same enums the CLI validates against (MAINTAIN_ACTION_CLASSES/MAINTAIN_AUTONOMY_LEVELSinloopover-mcp.js) — read the CLI file directly for the exact allowed values, don't guess.this.toolResult(...)wrapping, a doc comment tagged with the relevant tracking issue number).Deliverables
agentPausedtoggle (pause/resume) with the same maintainer-manage auth as sibling write toolsautonomylevel setting, same auth + read-merge-write semanticsTest Coverage Requirements
99%+ patch coverage (branch-counted), including the unauthorized-caller rejection branch and the read-merge-write "other classes preserved" branch.
Expected Outcome
An MCP client with maintainer access can pause/resume agent actions and set a per-action autonomy level for a repo — the same capability
loopover-mcp maintain pause|resume|set-levelalready provides via CLI — closing the last gap in an otherwise-fully-mirroredmaintaincommand family.Links & Resources
packages/loopover-mcp/bin/loopover-mcp.js:1783-1800(pause/resume/set-levelCLI implementation)src/mcp/server.ts:2260-2271(loopover_get_automation_state, the read-side sibling whose comment names this as the known-missing write half)src/mcp/server.ts(loopover_propose_action,loopover_decide_pending_action— the maintainer-access-required pattern to mirror)