Add Redview MCP to fleet coding harnesses #291
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:cosmos
host:electra
host:fleet
host:lena
host:lyra
host:mass-storage
host:media1
host:nimmog-de
host:nova
host:pangolin
host:pangolin-vps
host:phone
host:router
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nix-idioms-hygiene
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:gitlab
service:hermes
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
service:tdarr
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!291
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/redview-mcp-fleet"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Redview 2.6.0 embeds a Streamable HTTP MCP endpoint, but fleet coding harnesses currently have no registration or client credential for it. Add Redview to the shared registry for Codex, OpenCode, Pi and Antigravity on Electra, Lena, Vega and Lyra through the existing HTTPS ingress.
Clients authenticate with X-Api-Key using the user-provisioned, encrypted secrets/redview-mcp.yaml. The dedicated recipient rule scopes the key to the four harness hosts and recovery identities. Codex activation preserves personal settings and comments while reconciling its environment-backed HTTP header. Document provisioning, enablement and rotation; add four-host registry checks and configuration regression tests.
Refs #289 and #290. Milestone: Redview MCP Fleet Integration.
Validation:
Remaining acceptance:
Reviewed existing build warnings: duplicate NTFS utilities, upstream stdenv deprecations and the Gawk Info index warning did not block the canary. At the user's request, retain these as observations only; no warning-suppression workarounds or cleanup changes are included.
Automated code review
Reviewed commit:
95375b25b1c011106869d2c4a95aab70733337e1Verdict: Ready to merge
No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.
Overall assessment
The Redview MCP registration matches the existing registry contract in modules/mcp/default.nix: modules/mcp/redview.nix returns the documented keys (name/enable/type/url/secretName/tokenEnvVar, sopsSecrets, agy, opencode, codexSnippet), it is imported in the same serverModules list as the other servers, and scripts/check-redview-mcp.nix asserts exactly the shapes the registry derives for agy, opencode, standard (Pi) and the sops-secret/tokenExports paths. The new .sops.yaml creation rule (secrets/redview-mcp.yaml$) is ordered before the catch-all rules, does not collide with the earlier secrets/redview.yaml$ rule, and its seven listed recipients match the seven recipients recorded in secrets/redview-mcp.yaml; the key path redview/mcp/api-key matches both the sopsSecrets key and the check assertion. The new flake check evaluates that assertion plus the Python regressions. I found no defect that would break evaluation or the deterministic gate; the remaining findings are one new activation failure mode and two documentation/coverage gaps.
Blocking findings
None.
Important findings
None.
Suggestions
Redview's Codex snippet is the only unguarded Python call in the activation dag entry, so an unparseable ~/.codex/config.toml now fails activation (modules/mcp/redview.nix:41; medium confidence)
modules/mcp/redview.nix:41-44 emits a bare
${python}/bin/python .../ensure-codex-http-mcp.py "$HOME/.codex/config.toml" redview ...invocation, which modules/mcp/default.nix:179-180 splices into home.activation.codexMcpConfig (modules/profiles/ai-agents.nix). scripts/ensure-codex-http-mcp.py:38 calls ensure_server() in main with no try/except, and scripts/test-codex-http-mcp.py:59-64 asserts that tomlkit.exceptions.ParseError propagates out of ensure_server while the file is left intact. Every other command in that same dag entry is guarded with|| true(e.g. thecodex mcp remove/codex mcp getlines in modules/profiles/ai-agents.nix), so this new call is the first one whose non-zero exit is not swallowed.Impact: A user-authored syntax error in ~/.codex/config.toml on Electra, Lena, Vega or Lyra now turns the Redview activation step into a hard error instead of a no-op, and the rest of the MCP registry entries in that dag entry are skipped. This is a new failure mode for this path: no previous activation step parsed user-authored TOML.
Suggested fix: Keep the fail-closed behaviour but make it diagnosable and non-fatal to the rest of the registry: catch tomlkit.exceptions.ParseError in the main block of scripts/ensure-codex-http-mcp.py, print the offending path and parser message to stderr, and exit with a distinct code; then either append
|| trueto the generated snippet in modules/mcp/redview.nix or emit a warning line so the remaining harness entries still activate.The new redview/mcp/api-key credential is not added to the Known Secrets index (secrets/README.md:119; high confidence)
The change adds an 'Adding New Secrets' paragraph for secrets/redview-mcp.yaml at secrets/README.md:119-133, but the 'Known Secrets' table at secrets/README.md:207 has a row for every other MCP client credential file -
synthseek/mcp/api-keyin secrets/synthseek-mcp.yaml,navidrome/mcp/tokenin secrets/navidrome-mcp-clients.yaml,kiwifs/mcp/tokenin secrets/kiwifs-mcp.yaml,karakeep/mcp/api-key,pangolin/mcp/token,trilium/etapi-token,beszel/mcp/*- and no row for redview/mcp/api-key in secrets/redview-mcp.yaml.Impact: The canonical secret index undercounts the new scoped credential, so audit, rotation or recipient-scope work driven from that table will miss redview-mcp.yaml; the rotation recipes themselves are unaffected because they glob
secrets/*.yaml.Suggested fix: Add a Known Secrets row for
redview/mcp/api-keyin secrets/redview-mcp.yaml naming modules/mcp/redview.nix as the consumer, and stating that it is the direct Redview Settings API key scoped to Electra, Lena, Vega, Lyra plus the recovery identities, and is distinct from Lyra's secrets/redview.yaml service credentials and the remote-worker key.The four-host check forces enable = true, so it never exercises the provisioning gate that actually enables Redview MCP (scripts/check-redview-mcp.nix:12; medium confidence)
checkHost overrides the option with
mcp.redview.enable = true(scripts/check-redview-mcp.nix:11-13) and injects a fake sops.secrets/placeholder entry, so the assertions only prove the registry shape once enabled. The real enablement is the default at modules/common/default-config.nix:263 (builtins.pathExists config.nixosConfig.mcp.redview.sopsFile) with the default path at line 276 (../../secrets + "/redview-mcp.yaml"); neither the check nornix flake checkwould fail if that path were wrong or if secrets/redview-mcp.yaml were untracked.Impact: A typo in the sopsFile default, or a secrets/redview-mcp.yaml that is not git-tracked, would silently disable Redview MCP on the whole fleet while every gate in this change still passed; the failure would only surface in live tools/list output.
Suggested fix: Add one assertion that does not override enable - e.g. evaluate the default for each of the four hosts and assert
registry.sopsSecrets ? redview-mcp-api-key(or that the default evaluates to true) using the tracked credential - so the check proves the provisioning gate itself, not only the shape once enabled.Tests and validation
Questions
typekey beside the new url entry.enabled = falsefrom a pre-existing [mcp_servers.redview] table the intended boundary? scripts/test-codex-http-mcp.py:16 and the assertion at lines 37-41 keep enabled = false while rewriting the transport, so a user who previously disabled Redview keeps it disabled after redeploy.Review limitations
nix flake check, the redview-mcp flake check, or the Python regressions; I read modules/mcp/default.nix, modules/mcp/redview.nix and scripts/check-redview-mcp.nix to compare the asserted shapes.Diff coverage
.sops.yaml: reviewed — included in a context-limited batchREADME.md: reviewed — included in a context-limited batchflake.nix: reviewed — included in a context-limited batchmodules/common/default-config.nix: reviewed — included in a context-limited batchmodules/mcp/default.nix: reviewed — included in a context-limited batchmodules/mcp/redview.nix: reviewed — included in a context-limited batchscripts/check-redview-mcp.nix: reviewed — included in a context-limited batchscripts/ensure-codex-http-mcp.py: reviewed — included in a context-limited batchscripts/test-codex-http-mcp.py: reviewed — included in a context-limited batchsecrets/README.md: reviewed — included in a context-limited batchsecrets/redview-mcp.yaml: reviewed — included in a context-limited batchReview metadata