feat(mcp): add remote + stdio tool surfaces for loopover_get_repo_focus_manifest - #7918
Closed
xfodev wants to merge 2 commits into
Closed
feat(mcp): add remote + stdio tool surfaces for loopover_get_repo_focus_manifest#7918xfodev wants to merge 2 commits into
xfodev wants to merge 2 commits into
Conversation
…us_manifest Register loopover_get_repo_focus_manifest as a remote MCP tool (src/mcp/server.ts) and a local stdio MCP tool (packages/loopover-mcp/bin), mirroring the two-surface loopover_get_maintainer_noise shape but replicating the GET /v1/repos/:owner/:repo/focus-manifest route's own auth: requireRepoAccess (the read-level maintainer/owner/operator + session-repo-access mirror), not the stricter requireRepoApprovalQueueAccess. Read-only: no refresh/PUT tool, no new REST route, no new human CLI verb. Closes JSONbored#7808
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…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.
xfodev
force-pushed
the
feat/get-repo-focus-manifest-two-surfaces-7808
branch
from
July 21, 2026 17:44
62479a6 to
07adbff
Compare
Contributor
|
This repository reviews pull requests one-shot: the PR must be correct as originally opened. Pushing an additional commit closes it automatically instead of restarting review — open a fresh pull request with every fix included. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7918 +/- ##
===========================================
+ Coverage 58.78% 80.85% +22.06%
===========================================
Files 730 90 -640
Lines 74842 24387 -50455
Branches 22839 4691 -18148
===========================================
- Hits 43999 19719 -24280
+ Misses 27180 4427 -22753
+ Partials 3663 241 -3422
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the two missing MCP surfaces for
loopover_get_repo_focus_manifest(a repo's own persisted focus manifest + compiled policy): a remote MCP tool insrc/mcp/server.tsand a local stdio MCP tool inpackages/loopover-mcp/bin. Mirrors the two-surfaceloopover_get_maintainer_noiseshape but replicates the underlyingGET /v1/repos/:owner/:repo/focus-manifestroute's own auth —requireRepoAccess(the read-level maintainer/owner/operator + session-repo-access mirror), not the stricterrequireRepoApprovalQueueAccess(which adds a live-write check the GET route does not perform).Read-only, per the issue's scope boundary: no tool for the
refresh(POST)/PUTwrite routes, no new REST route, no new human CLI verb.What changed
src/mcp/server.ts: registerloopover_get_repo_focus_manifest(inputownerRepoShape,focusManifestOutputSchemareturning{ repoFullName, manifest, policy }), add itsMCP_TOOL_CATEGORIESentry ("maintainer"), and agetRepoFocusManifesthandler callingloadRepoFocusManifest+compileFocusManifestPolicyexactly as the GET route does, behindrequireRepoAccess.packages/loopover-mcp/bin/loopover-mcp.ts: register the local stdio tool proxyingGET ${repoBase}/focus-manifestviaapiGet.Testing / coverage
test/unit/mcp-output-schemas.test.ts: authorized success (seeded manifest →{ repoFullName, manifest.present, policy }) and the forbidden branch (static mcp identity outside the read allowlist →cannot access this repository); added the tool toTOOLS_WITH_OUTPUT_SCHEMA. Both run in-process againstLoopoverMcp(env).createServer(), so every changed line/branch insrc/mcp/server.tsis Codecov-covered.test/unit/mcp-cli-repo-focus-manifest.test.ts: in-process stdio invocation (via loopover_plan_repo_issues has no REST route, CLI command, or local stdio MCP tool #7764'sisProcessEntrypointguard +InMemoryTransport) so the bin tool'sapiGet-proxy body gets real Codecov-measured coverage — a subprocess spawn can't be v8-instrumented.test/unit/mcp-tool-rename-aliases.test.ts: tool-count invariant → 83. This also reconciles a pin drift — feat(mcp): add remote + stdio tool surfaces for loopover_get_activation_preview #7887 registeredloopover_get_activation_preview's stdio tool without bumping this pin (live count had reached 82), documented inline in the same convention as the earlier#6942note.Incidental regression fix (required for CI)
This PR's
packages/loopover-mcp/**change pulls the wholemcp-cli-*.test.tssuite into CI's scoped test selection, which surfaced a pre-existing failure:test/unit/mcp-cli-activation-preview.test.ts(added by #7887) hangs to its hook timeout onmain. #7764 later gated the bin's top-levelawait server.connect(...)behindisProcessEntrypoint()(realpath(argv[1]) === realpath(this module)); that test setargv[1]to the bare string"loopover-mcp", sorealpathSyncthrows → the guard is false → the server never connects →client.connecthangs. #7887 merged just before #7764, so its own CI never ran against the guard. Fixed by pointingargv[1]at the bin's resolved path (test-only change).No REST/OpenAPI change (the focus-manifest route already exists), no migrations, no wrangler changes.
Closes #7808