Skip to content

loopover_get_gate_config_effective has a REST route but no remote MCP tool or local stdio MCP tool #7800

Description

@JSONbored

Context

GET /v1/repos/:owner/:repo/gate-config/effective (src/api/routes.ts:3412) returns a repo's current effective self-tuned gate thresholds (confidenceFloor, scopeCap, shadowPending) — read-only, resolved from loadOverride/loadShadowOverride. Its own comment says it's "[g]ated behind the same most-conservative repo-scoped read precedent the reviewability route (#6154) uses," and the code confirms it: requireStaticProtectedApiToken + the identical identity.actor === "mcp" && !isMcpReadRepoAllowed(...) allowlist check that GET .../pulls/:number/reviewability uses. loopover_get_pr_reviewability has a full remote MCP tool + local stdio tool; gate-config/effective has neither.

Requirements

⚠️ Required pattern — mirror loopover_get_pr_reviewability's auth handling and two-surface shape (src/mcp/server.ts:2350-2358, stdio registration packages/loopover-mcp/bin/loopover-mcp.ts:1427-1434). This tool takes only owner/repo (no pull number) — use ownerRepoShape, not ownerRepoPullShape. No separate human CLI verb exists for reviewability either — do not add one here.

  • Register loopover_get_gate_config_effective as a remote MCP tool in src/mcp/server.ts, input ownerRepoShape, calling the same loadOverride/loadShadowOverride pair the REST route already calls, returning the identical { repoFullName, effective: { confidenceFloor, scopeCap: { files, lines } }, shadowPending } shape.
  • Add loopover_get_gate_config_effective to MCP_TOOL_CATEGORIES as "maintainer" (this is repo-scoped self-tune configuration, the same family as loopover_get_gate_precision).
  • Register loopover_get_gate_config_effective as a local stdio MCP tool in packages/loopover-mcp/bin/loopover-mcp.ts, calling GET ${repoBase}/gate-config/effective via apiGet.
  • Do not add a new human-typable CLI verb.
  • Do not change loadOverride, loadShadowOverride, the REST route, or its auth gate.

Deliverables

  • loopover_get_gate_config_effective registered as a remote MCP tool in src/mcp/server.ts, category "maintainer", input ownerRepoShape.
  • loopover_get_gate_config_effective registered as a local stdio MCP tool in packages/loopover-mcp/bin/loopover-mcp.ts.
  • No new REST route and no new human CLI verb.

Test Coverage Requirements

src/mcp/server.ts and packages/loopover-mcp are both under the 99%+ Codecov patch gate. Add a unit test for the new remote-tool registration mirroring loopover_get_pr_reviewability's test, and a stdio-tool test matching the existing sibling-tool convention (verify packages/loopover-mcp's coverage.include scoping first).

Expected Outcome

loopover_get_gate_config_effective is reachable via remote MCP and local stdio MCP with the same auth boundary its REST route already enforces — an MCP client (including a self-host operator's mcp-token session, if allowlisted) can read a repo's effective gate thresholds without needing raw HTTP.

Links & Resources

  • src/api/routes.ts:3412 (existing REST route, requireStaticProtectedApiToken + isMcpReadRepoAllowed-gated)
  • src/mcp/server.ts:2350-2358, packages/loopover-mcp/bin/loopover-mcp.ts:1427-1434 (the loopover_get_pr_reviewability pattern to mirror)
  • src/mcp/server.ts:1798-1890 (MCP_TOOL_CATEGORIES map)

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

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions