feat(mcp): add remote + stdio tool surfaces for loopover_get_activation_preview - #7887
Conversation
…vation_preview GET /v1/repos/:owner/:repo/activation-preview had a REST route but no remote MCP tool and no local stdio MCP tool, unlike its maintainer-noise sibling which has both. Register loopover_get_activation_preview as a remote MCP tool (category maintainer, assembling the same getRepository + resolveRepositorySettings + listPullRequests -> buildMaintainerActivationPreview the route uses, behind the same maintainer gate) and as a local stdio tool proxying GET the existing route. No REST route, CLI verb, service, or UI change. Closes JSONbored#7799
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7887 +/- ##
==========================================
- Coverage 91.40% 82.31% -9.10%
==========================================
Files 730 90 -640
Lines 74763 24353 -50410
Branches 22815 4684 -18131
==========================================
- Hits 68335 20045 -48290
+ Misses 5385 4090 -1295
+ Partials 1043 218 -825
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-21 16:32:00 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk 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.
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.
|
Mirror the maintain-family registerStdioTool pattern (JSONbored#6382/JSONbored#7877) and reuse the same REST endpoint the existing `maintain automation-state` CLI already calls. Bump the stdio tool-count invariant to 83 (correcting the stale pin left after JSONbored#7887). Closes JSONbored#7752. Co-authored-by: Cursor <cursoragent@cursor.com>
Closes JSONbored#7754 Mirrors the existing registerStdioTool siblings (loopover_get_gate_precision, loopover_get_outcome_calibration, loopover_plan_repo_issues) exactly: same input-schema convention, same stdioToolDescription lookup, same toolResult formatting. The tool proxies to the same POST {repoBase}/repo-docs/refresh endpoint the maintain refresh-docs CLI subcommand already calls, so there is no duplicated HTTP logic. Extends the existing array-driven test/unit/mcp-cli-maintain-tools.test.ts (same pattern PR JSONbored#7877 used for its outcome-calibration sibling) rather than adding a new dedicated test file, reusing the fixture server's existing /repo-docs/refresh route. Also corrects test/unit/mcp-tool-rename-aliases.test.ts's pinned tool count: the live count was 83, not 82, because JSONbored#7799 (PR JSONbored#7887) registered loopover_get_activation_preview without ever bumping this pin.
…SONbored#7764's entrypoint guard JSONbored#7764 gated the bin's top-level `await server.connect(new StdioServerTransport())` behind isProcessEntrypoint() (realpath(argv[1]) === realpath(this module)). JSONbored#7887's activation-preview test set argv[1] to the bare string "loopover-mcp", so realpathSync throws, the guard is false, the top-level connect is skipped, its mocked in-memory transport is never wired to the server, and client.connect hangs to the 10s hook timeout. JSONbored#7887 merged just before JSONbored#7764, so its CI never saw the guard; main has been latently red on this test since. Point argv[1] at the bin's own resolved path so the guard is satisfied on import. Surfaced here because this PR's bin change pulls the mcp-cli-*.test.ts suite into scoped selection.
…SONbored#7764's entrypoint guard JSONbored#7764 gated the bin's top-level `await server.connect(new StdioServerTransport())` behind isProcessEntrypoint() (realpath(argv[1]) === realpath(this module)). JSONbored#7887's activation-preview test set argv[1] to the bare string "loopover-mcp", so realpathSync throws, the guard is false, the top-level connect is skipped, its mocked in-memory transport is never wired to the server, and client.connect hangs to the 10s hook timeout. JSONbored#7887 merged just before JSONbored#7764, so its CI never saw the guard; main has been latently red on this test since. Point argv[1] at the bin's own resolved path so the guard is satisfied on import. Surfaced here because this PR's bin change pulls the mcp-cli-*.test.ts suite into scoped selection.
Summary
GET /v1/repos/:owner/:repo/activation-preview(src/api/routes.ts, the deterministic maintainer-activation demo behindbuildMaintainerActivationPreview, gated by the per-repo maintainer gate) had a REST route but no remote MCP tool and no local stdio MCP tool — unlike itsloopover_get_maintainer_noisesibling, which has both. Mirrors that sibling exactly:loopover_get_activation_previewinsrc/mcp/server.ts(categorymaintainer),ownerRepoShapeinput, assemblinggetRepository+resolveRepositorySettings+listPullRequests→buildMaintainerActivationPreviewidentically to the route, behind the same maintainer gate.packages/loopover-mcp/bin/loopover-mcp.ts, proxyingapiGetof the existing route.No new REST route, no human CLI verb (the sibling has none);
buildMaintainerActivationPreview, the route, its gate, andsrc/services/**are unchanged.Tests
test/unit/mcp-cli-activation-preview.test.ts(new, in-process) drives the stdio tool via a real MCP client over an in-memory transport.mcp-output-schemas.test.tsgains the tool's output-schema entry plus a happy-path and a member-only-denied case, covering the remote registration in-process. Both new surfaces are 100% statement + branch covered;mcp-cli-completion-spec,mcp-tool-categories, andmcp-tool-rename-aliases(tool-count sync) pass.UI Evidence
N/A — no UI/frontend changes (backend MCP tool registration only; no
apps/**files touched).Validation
tsc --noEmitclean (my files); new tool registrations 100% covered; category-sync, completion-spec, output-schema, and tool-count tests pass; rebased on latestmain. No wallet/hotkey/trust-score/reward terms in tool output.Closes #7799