Skip to content

fix(setup): MCP servers launch with only their own key from fnox, not Doppler - #84

Merged
gutyoh merged 2 commits into
mainfrom
fix/mcp-backend-fnox
Nov 15, 2026
Merged

gutyoh merged 2 commits into
mainfrom
fix/mcp-backend-fnox

Conversation

@gutyoh

@gutyoh gutyoh commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Why

Doppler launched the brave-search and tavily MCP servers. The keys already live in fnox (age, fleet secrets/fnox.toml), Doppler isn't installed on the devbox or the rig, and the owner stopped using it.

Review of the first version caught a scope problem: fnox exec has no per-key selector, so it hands every server every secret fnox holds. A compromised release of a npx server would take them all. This version passes each server only its own key.

What changes

  • bin/mcp-fnox-inject (new, symlinked by setup.sh like mcp-env-inject):
    • It asks fnox for one key, from HOME, so a repository's fnox.toml is never read.
    • It exports that key alone and execs the server: one process, so Claude's signals reach it and no orphan is left.
    • An undecryptable or empty key stops the server with a message.
    • fnox is resolved on PATH, falling back to the stable mise shim.
  • lib/setup/mcp.sh:
    • detect_mcp_backend <key> decides per server, by that server's own key.
    • The fnox entry is mcp-fnox-inject <VAR> npx -y <package>.
    • check_mcp_env_vars reports per server.
  • lib/setup/opencode.sh: same backend and entry, per server.
  • Brave pinned: @brave/brave-search-mcp-server is pinned to 2.1.4 (bash, PowerShell registry, docs), as tavily already was.
  • Docs: how-to-add-mcp-server.md and architecture.md.

Follow-up: #85 moves mcp-key-rotate and the PowerShell setup off Doppler.

Evidence

  • bats:
    • new mcp-fnox-inject: 5/5 (only its key, asked for from HOME and never with exec; undecryptable and empty keys refused; the server replaces the helper's PID; bad input refused);
    • mcp-setup 23/23, including per-server detection;
    • opencode-setup 53/53, mcp-env-inject-sync 26/26, setup-parity 2/2, setup-cli 37/37.
  • just lint and just format-check: clean. shellcheck on the helper and its tests: clean.
  • Live on macOS, real fnox:
    • Both servers answer MCP initialize through the helper, with no TTY or Keychain.
    • Inside the server, only BRAVE_API_KEY is set; the other fnox secrets (Tavily, Firecrawl, pools, ntfy) are absent.
    • After re-registering, claude mcp list shows both ✔ Connected.

🤖 Generated with Claude Code

https://claude.ai/code/session_014j4P2qfZbMTXBNFRaZdyiY

… Doppler

Setup now registers each MCP server through bin/mcp-fnox-inject when fnox can
decrypt that server's key, and through mcp-env-inject with the env file
otherwise; Doppler no longer launches any server. The helper asks fnox for
one key, from HOME (a repository's fnox.toml is never read), exports it alone
and execs the server: `fnox exec` would hand every server every secret fnox
holds. A key fnox cannot decrypt stops the server with a message, and exec
keeps one process, so Claude's signals reach the server.

The backend is decided per server, by its own key, so a machine with Brave
in fnox and Tavily only in the env file gets each right. opencode's entries
follow. @brave/brave-search-mcp-server is pinned to 2.1.4, as tavily was.

mcp-key-rotate and the PowerShell setup keep Doppler for now (#85).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014j4P2qfZbMTXBNFRaZdyiY
@gutyoh
gutyoh force-pushed the fix/mcp-backend-fnox branch from 30563b3 to d23111d Compare November 15, 2026 20:38
@gutyoh gutyoh changed the title fix(setup): MCP servers launch through fnox, not Doppler fix(setup): MCP servers launch with only their own key from fnox, not Doppler Nov 15, 2026
The helper swallowed fnox's stderr, so a missing age key looked the same as
a missing secret. The docs also say that keys already exported in Claude
Code's own environment still reach every server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014j4P2qfZbMTXBNFRaZdyiY
@gutyoh
gutyoh merged commit b454fd1 into main Nov 15, 2026
14 checks passed
@gutyoh
gutyoh deleted the fix/mcp-backend-fnox branch November 15, 2026 20:47
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.

1 participant