fix(brains): Claude Code owns the MCP credential via its own OAuth login [BRNS-CORE-015] - #18
Conversation
stefan-ssv-labs
left a comment
There was a problem hiding this comment.
✅ review-pr: clean against BRNS-CORE-015.
RaekwonIII
left a comment
There was a problem hiding this comment.
Reviewed against #16 (its stacked base) — a faithful, correct mirror of the Codex cutover for Claude Code. Approving, with two non-blocking confirmations at the end.
What checks out
- Manifest changes are right and correctly atomic.
Authorization: Bearer ${user_config.token}removed,token→required: falsewith reframed copy, both manifests → 2.5.0. These must ship together: removing the header while leavingrequired: trueunset makes Claude Code silently DROP the server, and leaving the header with an empty token sendsBearerand disables OAuth. The drift nudge now appendsclaude mcp login plugin:brains:brainsso an already-installed user re-auths after the force-reinstall. - The contract test is excellent — and stronger than #16 exactly where #16 was weakest.
claude plugin validate --strictruns for real in CI against a pinned@anthropic-ai/claude-code@2.1.220and FAILS CLOSED when the CLI is missing (assert(!inCI, …)). That's the lesson from #16's SKIP-in-CI resolved-config check applied where the CLI is actually pinnable — nicely done. Plus: verbatim copy pins,bash -non every README shell block (catches the<your token>angle-bracket-redirection class), a duplicate-root-mcpServersdefense (JSON.parse keeps the last dup), and an in-server key allow-list sincevalidate --strictis silent on unknown nested keys. 68 mutation proofs. - Valid JSON, only the 6 intended files touched, README slicing headings all present.
Ordering note
#18 is stacked on #16, so it merges after/with it. Worth surfacing that this inverts #16's "guide-live-before-plugin" rule — #16 required the web guide (#1066) live first; here the redesigned web guide (#1072) is gated to ship after 2.5.0 publishes. That's fine because #18 carries its own migration guidance (README ### Already installed? + the login-carrying drift nudge), so it's self-sufficient during the window before #1072 is live — just confirm that inversion is intentional.
Two non-blocking confirmations
- Existing-user notification. #16 said existing token-based installs are "notified directly." #18 flips Claude Code — likely the larger install base — and the force-reinstall to 2.5.0 breaks existing header auth until the user runs
claude mcp login. The drift nudge + README migration path mitigate in-client; is there a direct-notify plan mirroring #16's for the Claude cohort? - Guide-ordering inversion above — confirm intended.
Neither blocks merge.
The base branch was changed.
f646c37 to
af04781
Compare
Summary
mcpServers.brains.headersis deleted and users sign in withclaude mcp login plugin:brains:brains— mirroring the Codex cutover in fix(brains): Codex owns the MCP credential via its own OAuth login #16. A declared Authorization header disables the OAuth login outright, so the two shapes cannot coexist.userConfig.tokenbecomes optional with copy naming its real job (conversation capture and the inbox): arequired: trueconfig left unset makes Claude Code silently drop the MCP server, so header removal and the optional token ship as one atomic change.### Optional:token section and an### Already installed?migration path; the drift nudge adds the sign-in step.claude plugin validate --strictsilently), token copy and the pre-Optional README region pinned verbatim, shell blocks must parse, andclaude plugin validate --strictruns for real in CI — fail-closed when the CLI is missing — via a pinned@anthropic-ai/claude-codeinstall.Test
CLAUDE_CONFIG_DIR: no-token install leaves the server registered and needing authentication, login completes, bearer replays on reconnect. Verified on Claude Code 2.1.220.Board: BRNS-CORE-015