Skip to content

feat(mcp): add an MCP tool for GET /v1/repos/:owner/:repo/pulls/:number/reviewability (route already MCP-auth-aware, no tool on either server) #6154

Description

@JSONbored

Context

src/api/routes.ts:2892-2929 implements GET /v1/repos/:owner/:repo/pulls/:number/reviewability and explicitly branches on identity.actor === "mcp" with isMcpReadRepoAllowed(...) (src/api/routes.ts:2897) — the same MCP-specific repo-allowlist gate already used by /intelligence (→ loopover_get_repo_context) and /issue-quality (→ loopover_get_issue_quality), both of which do have MCP tools. Grepping both src/mcp/server.ts and packages/loopover-mcp/bin/loopover-mcp.js for "reviewability" turns up nothing except unrelated PII-redaction regexes. This route was clearly built with MCP consumption in mind (the auth plumbing is already there) but no tool was ever added on either server.

Requirements

  • Add loopover_get_pr_reviewability (or a name matching this repo's existing tool-naming convention) to src/mcp/server.ts, calling the existing route, following the same isMcpReadRepoAllowed gating pattern loopover_get_repo_context/loopover_get_issue_quality already use.
  • Also register the equivalent tool in packages/loopover-mcp/bin/loopover-mcp.js for the local server, per this repo's now-established convention that a new remote tool gets a local mirror too (see the companion parity issues filed alongside this one).
  • Match the existing input schema/response shape the REST route already defines — don't invent a new response shape.

Test Coverage Requirements

99%+ Codecov patch coverage on any src/** changes; match packages/loopover-mcp's own test conventions for the local-server addition.

Deliverables

  • loopover_get_pr_reviewability (or equivalent name) added to src/mcp/server.ts.
  • Same tool added to packages/loopover-mcp/bin/loopover-mcp.js.
  • Tests for both.

Expected Outcome

An MCP-authenticated caller can query PR reviewability the same way it can already query repo intelligence and issue quality.

Links & Resources

  • src/api/routes.ts:2892-2929
  • src/mcp/server.ts (where loopover_get_repo_context/loopover_get_issue_quality show the existing pattern to match)

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