Skip to content

feat(mcp): expose maintain pause/resume/set-level as MCP tools (write-side gap in the automation control surface) #6087

Description

@JSONbored

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

  • MCP tool(s) exposing agentPaused toggle (pause/resume) with the same maintainer-manage auth as sibling write tools
  • MCP tool(s) exposing per-action-class autonomy level setting, same auth + read-merge-write semantics
  • Tests: successful pause/resume, successful set-level (confirming other action classes' levels are untouched), and an unauthorized-caller rejection test mirroring how existing write-side tools are tested

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions