Skip to content

feat(mcp): fnox replaces Doppler for key rotation and the PowerShell setup - #89

Merged
gutyoh merged 3 commits into
mainfrom
feat/fnox-replaces-doppler
Nov 18, 2026
Merged

gutyoh merged 3 commits into
mainfrom
feat/fnox-replaces-doppler

Conversation

@gutyoh

@gutyoh gutyoh commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Closes #85.

Problem

#84 moved MCP server launch in the bash setup onto fnox, through mcp-fnox-inject. Two things still used Doppler, which no fleet machine runs:

  • mcp-key-rotate: its doppler backend did the reads and writes, and was the one auto-detected.
  • The PowerShell setup (lib/setup-ps/mcp.ps1, opencode.ps1): it detected Doppler and registered servers behind doppler run.

Change

mcp-key-rotate gets a fnox backend

It is auto-detected when fnox holds the service's active key.

Reads

  • Reads run from $HOME, the way mcp-fnox-inject reads at server launch, so a repository's fnox.toml is never read.
  • They run with no stdin, so fnox can't stop at a prompt.
  • A name fnox doesn't hold reads as empty, the same as a name missing from the dotenv file.

Writes

  • A rotation, or an --add, is written to the fnox.toml in KEY_ROTATE_FNOX_DIR, the file the keys come from.
  • The value goes to fnox set on stdin, never as an argument where ps would show it.
  • It's read back from that same file before the rotation counts. A store that fails, or doesn't read back as written, is an error, and nothing is reported as rotated.
  • Without KEY_ROTATE_FNOX_DIR, writes are refused with the reason: $HOME may read a deployed copy through an import, and a write there is lost on the next deploy. --status and --quota still work.

Afterwards

  • It reports whether the new key is active now (the $HOME view already shows it) or reaches each machine once its copy of the file updates (commit and push it).
  • It never writes the MCP keys env file. Servers read fnox when they start.

Settings

  • KEY_ROTATE_FNOX_PROVIDER names the provider for a key the file doesn't hold yet. Otherwise fnox keeps each secret's existing provider.
  • KEY_ROTATE_BACKEND accepts fnox, dotenv or auto. Anything else, doppler included, exits 2.

PowerShell setup, at parity with bash

  • Get-McpBackend -Key decides per server. A server gets mcp-fnox-inject with only its own key when fnox, asked from $HOME, can decrypt that key, and mcp-env-inject otherwise. OpenCode entries follow the same rule.
  • setup.ps1 now installs mcp-fnox-inject next to mcp-env-inject.
  • Test-McpEnvVar reports each server's source.

Doppler removed

The Doppler code, docs, .env.example line and test mocks are gone. Two exceptions:

  • The secret guard still protects ~/.doppler, for anyone who has it.
  • The rotation tests still check that KEY_ROTATE_BACKEND=doppler is refused.

Tests

  • bats: the 128 doppler-backed rotation cases were ported to a fnox mock. The mock separates the $HOME view from the source fnox.toml and logs each call's folder and arguments. 8 new cases cover:
    • auto-detection;
    • reads from HOME and writes in the folder, with no key ever in argv;
    • the refusal without a folder;
    • a failed store and a read-back mismatch;
    • "active now" against a deployed copy;
    • no env-file write;
    • the provider for a new key;
    • refused backends.
  • The touched suites pass 170/170 under bash 5.3 and 94/94 under stock bash 3.2. The full suite passes 1488 of 1490 on the rig. The other two: a provider-flag test, fixed in this head, and the statusline forecast test, which fails on main too and depends on the time of day.
  • Pester: 196/196, including 6 rewritten or new cases: per-server fnox detection, fnox asked from HOME, failed or empty answers, the fnox JSON, and OpenCode per server. tests/powershell-checks.ps1: PSScriptAnalyzer is clean.
  • Mutation controls: 13/13 killed. Each one removes one guard:
    • reads from HOME;
    • writes in the folder;
    • the value on stdin;
    • the folder refusal;
    • the read-back;
    • the store failure;
    • the "where" message;
    • no env-file sync;
    • the provider;
    • the backend refusal;
    • auto-detection needing a key;
    • an empty read for a missing name.
  • just lint and just format-check are clean.

🤖 Generated with Claude Code

gutyoh and others added 3 commits November 18, 2026 20:33
…setup

Closes #85. #84 moved bash's MCP launch to fnox; key rotation and the
Windows installer still spoke Doppler, which no fleet machine runs.

mcp-key-rotate: a fnox backend, auto-detected when fnox holds the
service's active key.
- Reads go through HOME, as mcp-fnox-inject reads at server launch, so a
  repository's fnox.toml is never read; a name fnox lacks reads as empty.
- A rotation is written to the fnox.toml in KEY_ROTATE_FNOX_DIR, the file
  the keys come from, with the value on stdin (never in argv), and read
  back before it counts. Without the folder it refuses: HOME may read a
  deployed copy that a write would be lost from.
- It says whether the new key is active now or reaches each machine once
  its copy of the file updates. KEY_ROTATE_FNOX_PROVIDER names the
  provider for a key the file lacks. KEY_ROTATE_BACKEND accepts fnox,
  dotenv or auto, and refuses anything else.

PowerShell setup: per server, as bash does, mcp-fnox-inject with that
server's key alone where fnox decrypts it, else mcp-env-inject; OpenCode
alike; setup.ps1 installs mcp-fnox-inject. The Doppler code, docs and
tests are gone; the secret guard keeps ~/.doppler among the paths it
protects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hanges before a deploy build on each other

Cross-review found reads from HOME (a deployed copy) and writes to the
source fnox.toml: a second --add or rotation before the copy updated
started from stale data, and dropped the first. With KEY_ROTATE_FNOX_DIR
set, every read of a change now goes to that file; HOME stays for
detection and for saying whether this machine reads the result already.

- A first key goes in as the active key before the pool, so a failed
  pool write still leaves a key that works.
- The refusal without KEY_ROTATE_FNOX_DIR says what to run, which the
  auto-rotate hook relays; a failed store says to check fnox can decrypt.
- PowerShell asks fnox once per name per run, and only its exit code and
  answer decide, never a warning on stderr.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l to change, and detect fnox from the source too

Without the folder, a rotation or --add read HOME's copy first, and a copy
that lagged at one key stopped at "nothing to rotate to" instead of the
refusal that says what to run. Detection also accepts the named source
file, for a machine whose HOME does not import it yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gutyoh
gutyoh merged commit c37be33 into main Nov 18, 2026
14 checks passed
@gutyoh
gutyoh deleted the feat/fnox-replaces-doppler branch November 18, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move mcp-key-rotate and the PowerShell setup off Doppler, onto fnox

1 participant