Skip to content

feat(mcp): register loopover_close_pr write-tool in both MCP surfaces (#6615) - #6715

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:feat-mcp-loopover-close-pr-6615
Jul 16, 2026
Merged

feat(mcp): register loopover_close_pr write-tool in both MCP surfaces (#6615)#6715
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:feat-mcp-loopover-close-pr-6615

Conversation

@jaytbarimbao-collab

Copy link
Copy Markdown
Contributor

Closes #6615.

buildClosePrSpec (packages/loopover-engine/src/miner/local-write-tools.ts) is the only one of the 9 buildXSpec local-write-tool builders with no MCP tool — it is fully implemented, tested, and already consumed internally (by the claim-conflict resolver), but no MCP client could call it. This adds loopover_close_pr to reach parity with its 8 registered siblings, which all share this exact builder module.

Changes

  • src/mcp/server.ts — import buildClosePrSpec; add closePrShape (repoFullName + number + optional comment, same bounds as the sibling shapes); register the tool in the same #780 write-tools block via the existing register(...) wrapper (inputSchema: closePrShape, outputSchema: localWriteActionOutputSchema, handler this.toolResult(this.localWriteSpec(buildClosePrSpec(input)))); add its MCP_TOOL_CATEGORIES entry ("agent").
  • packages/loopover-mcp/bin/loopover-mcp.js — mirror the tool: import, closePrShape, STDIO_TOOL_DESCRIPTORS entry, and registerStdioTool block, alongside the other 8.

Scope / safety

No new write path and no new auth — like its siblings it just returns a LOCAL-execution spec (gh pr close <n> --repo '<repo>', optionally && gh pr comment <n> --repo '<repo>' --body '<comment>') the caller runs with its own gh credentials; loopover never performs the write. The generated command exactly matches what buildClosePrSpec already produces (no reimplementation).

Tests

  • test/unit/mcp-write-tools.test.ts (server) — asserts the exact command for both branches (with / without comment).
  • test/unit/mcp-cli-write-tools.test.ts (CLI stdio) — a dedicated loopover_close_pr case (both branches) + the tool added to the WRITE_TOOLS registration check (8 → 9).
  • test/unit/mcp-tool-rename-aliases.test.ts — the tool-count guard bumped 62 → 63 (with a history-comment line), and the name-set assertion picks it up automatically.

Full mcp suite green locally: 90 files / 726 tests pass, plus tsc clean.

…JSONbored#6615)

buildClosePrSpec is the only one of the 9 local-write-tool builders with no
MCP tool — fully implemented, tested, and already consumed internally, but no
MCP client (remote or local stdio) could call it. This registers
loopover_close_pr to reach parity with its 8 registered siblings, which all
share this exact builder module.

- src/mcp/server.ts: import buildClosePrSpec, add closePrShape (repoFullName +
  number + optional comment, same bounds as the sibling shapes), register the
  tool in the JSONbored#780 write-tools block, and add its MCP_TOOL_CATEGORIES entry.
- packages/loopover-mcp/bin/loopover-mcp.js: mirror the tool — import,
  closePrShape, STDIO_TOOL_DESCRIPTORS entry, and registerStdioTool block.
- No new write path, no new auth: like its siblings it just returns a
  LOCAL-execution spec (gh pr close [&& gh pr comment]) the caller runs with
  its own gh creds; loopover never performs the write.

Tests: server-side and CLI cases assert the exact command for both the
with-comment and without-comment branches; the tool-count guard is bumped
62 -> 63. Full mcp suite green (90 files / 726 tests).

Closes JSONbored#6615
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.65%. Comparing base (3acc512) to head (f04aa4f).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6715   +/-   ##
=======================================
  Coverage   93.65%   93.65%           
=======================================
  Files         681      682    +1     
  Lines       68098    68117   +19     
  Branches    18695    18702    +7     
=======================================
+ Hits        63775    63793   +18     
  Misses       3347     3347           
- Partials      976      977    +1     
Flag Coverage Δ
shard-1 43.88% <66.66%> (-0.02%) ⬇️
shard-2 36.93% <66.66%> (+0.08%) ⬆️
shard-3 32.46% <66.66%> (+0.07%) ⬆️
shard-4 34.65% <66.66%> (+<0.01%) ⬆️
shard-5 31.71% <66.66%> (+0.77%) ⬆️
shard-6 45.38% <100.00%> (-0.28%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/mcp/server.ts 96.36% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 16, 2026
@loopover-orb

loopover-orb Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-16 20:35:03 UTC

5 files · 1 AI reviewer · no blockers · readiness 86/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR registers loopover_close_pr as an MCP tool in both the CLI stdio server and the remote server, mirroring the existing 8 sibling write-tool registrations exactly (same shape structure, same register() wrapper pattern, same builder from local-write-tools.ts). It closes the gap called out in the description — buildClosePrSpec was fully implemented and internally used but unreachable via MCP — and tests assert the exact generated gh command for both the with/without-comment branches in both surfaces, plus bump the tool-count guard from 62 to 63. The change is narrow, mechanical, and consistent with the established pattern for the other 8 builders.

Nits — 3 non-blocking
  • src/mcp/server.ts:427 and the mirrored bin/loopover-mcp.js closePrShape reuse the same repoFullName min(3)/max(SCENARIO_MAX_REPO_FULL_NAME_CHARS) bounds as siblings, which is fine, but the magic number 3 is already an existing convention copied verbatim rather than a new introduction — no action needed but worth confirming it's not meant to reference a shared constant.
  • The long-file flags on server.ts and loopover-mcp.js are pre-existing conditions this PR doesn't materially worsen (12-21 lines added to already-large files), not something introduced by this diff.
  • No functional changes needed — the diff is a faithful, well-tested mirror of the existing 8-tool registration pattern.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #6615
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 169 registered-repo PR(s), 88 merged, 4 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jaytbarimbao-collab; Gittensor profile; 169 PR(s), 4 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff registers loopover_close_pr in both src/mcp/server.ts (import, closePrShape, MCP_TOOL_CATEGORIES entry, register call) and packages/loopover-mcp/bin/loopover-mcp.js (import, shape, descriptor, registerStdioTool), matching the exact pattern of the 8 sibling tools as requested, with both comment/no-comment branches tested in mcp-write-tools.test.ts and mcp-cli-write-tools.test.ts plus the t

Review context
  • Author: jaytbarimbao-collab
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 169 PR(s), 4 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 1 step in the Signals table above.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 3f6591d into JSONbored:main Jul 16, 2026
16 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 17, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP: add loopover_close_pr write-tool to match its 8 registered siblings

1 participant