Skip to content

MCP tool + CLI mirror for contributor-issue-drafts/generate #6757

Description

@JSONbored

Context

POST /v1/repos/:owner/:repo/contributor-issue-drafts/generate exists in src/api/routes.ts:2510-2538, gated by requireAppRole(["maintainer","owner","operator"]), delegating to generateContributorIssueDrafts, with an explicit dry-run-by-default safety guard (if (parsed.data.create && parsed.data.dryRun !== false) return c.json({ error: "explicit_create_requires_dry_run_false" }, 400)). No corresponding MCP tool exists anywhere in src/mcp/server.ts (confirmed via grep for contributorIssueDraft/generateContributorIssueDrafts in both src/mcp/server.ts and loopover-mcp.js — zero hits), so this capability is REST/web-dashboard-only.

Requirements

  • Add loopover_generate_contributor_issue_drafts to src/mcp/server.ts's tool registry, requireRepoManageAccess-gated, mirroring the route's dryRun-defaults-true / create semantics exactly — the tool must never silently create issues.
  • Add a CLI mirror (e.g. maintain generate-issue-drafts [--create] --repo owner/repo).

Deliverables

  • loopover_generate_contributor_issue_drafts MCP tool
  • maintain generate-issue-drafts CLI subcommand
  • Unit test asserting the dry-run-by-default safety guard is preserved

Test Coverage Requirements

99%+ Codecov patch coverage on every changed line and branch in the new route/tool/CLI code, plus a test asserting output parity between the mirrored surfaces for identical input.

Expected Outcome

Contributor issue-draft generation is available over MCP/CLI, not just the web dashboard's REST call, without weakening the existing create-safety guard.

Links & Resources

Precedent: loopover_refresh_repo_docs (src/mcp/server.ts:2535) as the closest existing "maintainer-gated tool that can open real GitHub content" precedent for how to phrase the write-safety framing.

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