feat(mcp): register loopover_watch_issues as a local stdio tool - #7961
Conversation
loopover_watch_issues has a remote MCP tool (src/mcp/server.ts) and a `watch` CLI command, but no local stdio MCP tool registration. JSONbored#6746 added the REST route + CLI but never the matching stdio tool, so a self-host operator using the local MCP server couldn't call it. Extracts the /v1/contributors/:login/watches dispatch (list=GET, watch=POST, unwatch=DELETE) into a shared watchIssuesRequest helper reused by BOTH the `watch` CLI and the new stdio tool -- no duplicated HTTP logic. login resolves from arg / active session / LOOPOVER_LOGIN like the CLI; action defaults to list. test/unit/mcp-cli-watch-issues.test.ts drives it in-process (JSONbored#7764 entrypoint guard) so the registration + helper get real Codecov coverage, including all three actions, the with/without-labels POST bodies, and both throw branches. Existing mcp-cli-watch.test.ts still passes against the refactored CLI. Count 89 -> 90. Closes JSONbored#7763
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7961 +/- ##
==========================================
- Coverage 91.84% 81.96% -9.89%
==========================================
Files 735 91 -644
Lines 75462 23707 -51755
Branches 22956 4551 -18405
==========================================
- Hits 69309 19431 -49878
+ Misses 5071 4065 -1006
+ Partials 1082 211 -871
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 23:54:58 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.
|
Summary
Closes #7763 —
loopover_watch_issueshas a remote MCP tool (src/mcp/server.ts) and awatchCLI command, but no local stdio MCP tool registration. #6746 added the REST route + CLI but never the matching stdio tool, so a self-host operator using the local MCP server (not the CLI or remote MCP) couldn't call it.What changed (
packages/loopover-mcp/bin/loopover-mcp.ts)/v1/contributors/:login/watchesdispatch into a sharedwatchIssuesRequesthelper (list=GET,watch=POST,unwatch=DELETE) and reuses it in both thewatchCLI and the new stdio tool — so there's no duplicated HTTP logic (the CLI previously inlined the three calls).registerStdioTool("loopover_watch_issues", …)block next to the other contributor-scoped tools, mirroring the sibling pattern.loginresolves from arg / active session /LOOPOVER_LOGIN(same as the CLI);actiondefaults tolist;watch/unwatchrequirerepoFullName.stdioToolDescription(...)+ aSTDIO_TOOL_DESCRIPTORSentry (category: "utility").watchCliis nowexported (exactly likemaintainCli, loopover_plan_repo_issues has no REST route, CLI command, or local stdio MCP tool #7764) purely so a test can drive it in-process.Testing / coverage
test/unit/mcp-cli-watch-issues.test.tsruns everything in-process (the loopover_plan_repo_issues has no REST route, CLI command, or local stdio MCP tool #7764isProcessEntrypointguard +InMemoryTransport) so the registration, the shared helper, and the refactored CLI call sites all get real Codecov-measured coverage — a subprocess spawn can't be v8-instrumented:labelsPOST bodies, and both throw branches (no login; watch/unwatch missingrepoFullName).watchCLI driven in-process (list/add/remove) so the shared-helper call sites are covered.test/unit/mcp-cli-watch.test.ts(8 subprocess CLI tests) still passes unchanged — the helper preserves the exact request bodies it asserts.test/unit/mcp-tool-rename-aliases.test.tsbumped to 92.No REST/OpenAPI/CLI-surface change —
ui:openapi:check,command-reference:check,docs/manifestdrift all clean;build:mcpclean.(Supersedes #7957 (codecov gap — now closed via in-process CLI coverage) and #7959 (base conflict — now rebased onto current main).)