Skip to content

feat(mcp): add remote + stdio surfaces for loopover_get_gate_config_effective#7923

Closed
kai392 wants to merge 1 commit into
JSONbored:mainfrom
kai392:feat/7800-mcp-gate-config-effective
Closed

feat(mcp): add remote + stdio surfaces for loopover_get_gate_config_effective#7923
kai392 wants to merge 1 commit into
JSONbored:mainfrom
kai392:feat/7800-mcp-gate-config-effective

Conversation

@kai392

@kai392 kai392 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • Targeted unit tests for the new remote + stdio tool (+ tool-count pin); codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp (local)
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Full local matrix deferred to CI; exercised vitest for mcp-gate-config-effective, mcp-cli-gate-config-effective, and mcp-tool-rename-aliases, plus build:mcp.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

N/A — MCP/API only; no visible UI changes.

Notes

  • No human CLI verb (stdio MCP tool only), matching the issue ask.
  • One-shot PR: will not push follow-up commits onto this branch after open.

Made with Cursor

@kai392
kai392 requested a review from JSONbored as a code owner July 21, 2026 17:59
@superagent-security

Copy link
Copy Markdown
Contributor

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

…ffective

Closes JSONbored#7800: mirror the existing REST gate-config/effective route on remote MCP and local stdio (canAccessRepo / allowlist auth), with unit coverage and the 83→84 tool-count pin.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1640 1 1639 0
View the top 1 failed test(s) by shortest run time
test/unit/mcp-output-schemas.test.ts > MCP output schema discovery > exposes an outputSchema on EVERY registered tool (#550)
Stack Traces | 1.75s run time
AssertionError: tools missing a machine-validatable outputSchema: loopover_get_gate_config_effective: expected [ Array(1) ] to deeply equal []

- Expected
+ Received

- []
+ [
+   "loopover_get_gate_config_effective",
+ ]

 ❯ test/unit/mcp-output-schemas.test.ts:117:96

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-21 18:08:35 UTC

7 files · 1 AI reviewer · no blockers · CI failing · dirty

🛑 Suggested Action - Fix Blockers

Review summary
This PR adds a thin read-only MCP surface (remote + stdio) mirroring the existing GET /v1/repos/:owner/:repo/gate-config/effective route, reusing the same canAccessRepo/allowlist boundary and loadOverride/loadShadowOverride pair the REST route already uses. The implementation is a straightforward mirror of the established activation-preview/registry-snapshot pattern, with unit tests for forbidden/empty/populated states and the tool-count pin bumped 83→84. No new persistence or auth path is introduced, and coverage of the new branches (forbidden, no-override, live+shadow) looks complete.

Nits — 6 non-blocking
  • src/mcp/server.ts:3371 casts `this.env as unknown as StorageEnv`, matching an existing pattern elsewhere, but consider a narrower shared type if this cast recurs across more tools.
  • packages/loopover-mcp/bin/loopover-mcp.ts:1566 introduces an explicit `any` for the handler args (`{ owner, repo }: any`), which loses type safety even if it matches the surrounding file's convention — consider typing against `ownerRepoShape`.
  • The `capturedRequests` test flag in test/unit/mcp-cli-gate-config-effective.test.ts:37 was flagged by an automated secret scanner as a generic_secret_assignment; on inspection it's just `process.env.LOOPOVER_API_TOKEN = "in-process-token"`, a test fixture value, not a real secret — no action needed but worth confirming no real token ever lands in this file.
  • Both src/mcp/server.ts and packages/loopover-mcp/bin/loopover-mcp.ts are very large files; this PR's addition is small and consistent with the existing mirrored-tool pattern, so it's not a reason to block, just a standing maintainability note.
  • Consider extracting the owner/repo → effective-gate-config response shape into a shared helper used by both the REST route and this MCP tool to avoid future drift between the two response shapes.
  • Possible secret-shaped assignment in the diff (generic_secret_assignment) — Verify the value is not a real credential.

CI checks failing

  • validate
  • validate-tests (3)

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 #7800
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low 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: 47 registered-repo PR(s), 27 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kai392; Gittensor profile; 47 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The PR registers loopover_get_gate_config_effective as a remote MCP tool in src/mcp/server.ts using ownerRepoShape and the maintainer category, calls loadOverride/loadShadowOverride to build the exact required response shape, and adds a matching stdio tool in loopover-mcp.ts that proxies GET .../gate-config/effective, with no new REST route or CLI verb and accompanying unit tests.

Review context
  • Author: kai392
  • 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: 47 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests (3)); conflicts with the base branch — resolve and open a fresh PR). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

loopover_get_gate_config_effective has a REST route but no remote MCP tool or local stdio MCP tool

2 participants