feat(mcp): add admin tools to read/write a self-hosted instance's own private config#8198
Merged
Conversation
… private config Adds an opt-in "admin" MCP tool category (loopover_admin_get_config, loopover_admin_write_config, loopover_admin_list_config_backups) so a self-hosted operator can edit .loopover.yml through an MCP client instead of SSHing in and hand-editing YAML. Off by default and gated three ways: the tools aren't even registered unless LOOPOVER_MCP_ADMIN_ENABLED is set, calls require a separate LOOPOVER_MCP_ADMIN_TOKEN distinct from the ordinary shared MCP token, and the config bind mount stays read-only in docker-compose.yml until an operator flips it to :rw themselves. Writes validate against the same schema-aware validator loopover_validate_config already uses, back up any existing file first, and land atomically (temp file + rename). The new mcp-admin actor is explicitly excluded from the public dashboard/API settings surface, same as the existing shared mcp actor. Closes #7721
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | ac55586 | Commit Preview URL Branch Preview URL |
Jul 23 2026, 10:58 AM |
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Bundle ReportChanges will increase total bundle size by 8.39kB (0.11%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: loopover-uiAssets Changed:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8198 +/- ##
========================================
Coverage 92.07% 92.08%
========================================
Files 771 772 +1
Lines 77942 78082 +140
Branches 23545 23595 +50
========================================
+ Hits 71767 71902 +135
Misses 5062 5062
- Partials 1113 1118 +5
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 an opt-in
adminMCP tool category —loopover_admin_get_config,loopover_admin_write_config,loopover_admin_list_config_backups— so a self-hosted operator can edit their instance's private.loopover.yml(global default or per-repo override) through an MCP client instead of SSHing in and hand-editing YAML.Off by default and gated three separate ways:
LOOPOVER_MCP_ADMIN_ENABLEDis set (matches the existingLOOPOVER_REVIEW_SCREENSHOTS/_ENRICHMENT/_OPS"inert when off" convention — invisible intools/list, not just rejected at call time).LOOPOVER_MCP_ADMIN_TOKEN— distinct from the sharedLOOPOVER_MCP_TOKEN— so a leaked ordinary MCP credential can never reach these tools.:roby default indocker-compose.yml; an operator who wants write access flips it to:rwthemselves (documented, not silently unlocked by the flag).loopover_admin_write_configvalidates against the same schema-aware validatorloopover_validate_configalready exposes, writes a timestamped backup of any existing file first, and lands the new content atomically (temp file + rename).dryRun: trueruns the same validation and reports what would happen without touching disk. The newmcp-adminactor is explicitly excluded from the public dashboard/API settings surface, same as the existing sharedmcpactor.Closes #7721
Test plan
npm run typecheckcleannpm run test:cifull local gate green (unsharded coverage, parity tests,ui:lint/ui:typecheck/ui:test/ui:build, all drift checks)docker compose configvalidates the compose changestest/unit/mcp-admin-config-tools.test.ts(registration gating, auth boundary, get/write/dry-run/list-backups across global/repo/effective scopes), plus new coverage intest/unit/private-config.test.tsandtest/unit/auth.test.ts