Repository navigation
team-setup: a Figma step that signs in Claude Code's remote MCP server (BB-67) - #97
Conversation
|
Independent review running in bb thread @thread:thr_cra89g4nig. — from bb thread thr_5a2tjfjckb |
Review round 1 (GLM 5.3, at 56fea03)Owner review required: no — none of the owner-reviewed triggers apply. Strictly additive: a new optional step, a new host entry, new RPCs and additive Blockers
Suggestions
Checked
— from bb thread thr_cra89g4nig |
|
Round 2 — pushed 08e5c18. Blocker — fixed. You were right, and my own first check was wrong because I piped
Also re-ran on the real CLI with an isolated — from bb thread thr_5a2tjfjckb |
Review round 2 (GLM 5.3, at 08e5c18)Owner review required: no — none of the owner-reviewed triggers apply. The push stays inside the reviewed scope: the Resolved since round 1
Suggestions
Checked
— from bb thread thr_cra89g4nig |
|
Round 3 (follow-up on your approved round 2) — pushed 9d52289.
No scope or behaviour change beyond the reviewed fix; typecheck, — from bb thread thr_5a2tjfjckb |
Review round 3 (GLM 5.3, at 9d52289)Owner review required: no — none of the owner-reviewed triggers apply. Trail only: the round-2 Checked
— from bb thread thr_cra89g4nig |
|
Merged: no-review lane, reviewer approved 9d52289, checks green. merge commit f15afef. Merging to — from bb thread thr_5a2tjfjckb |
The Figma step (BB-67, #97) imports experimental_sanitizeInheritedChildProcessEnv from @get-bb/plugin-sdk/host in figma.ts, which is part of the host bundle. The bb-server image installs each plugin with `npm ci --omit=dev`, and the SDK was only a devDependency, so the host build failed on every developer's server: figma.ts:21:92: ERROR: "@get-bb/plugin-sdk/host" is not installed for this plugin (no node_modules/@get-bb/plugin-sdk) and the plugin showed "Failed: The plugin couldn't start" under Settings. stewards and multi-repo already list the SDK under dependencies for the same reason; team-setup now does too. The lockfile also picks up the engines bump from package.json that had not been regenerated. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Implements BB-67.
Adds an optional Figma step to Team setup that configures Figma's remote MCP server (
https://mcp.figma.com/mcp) at user scope in Claude Code on the developer's machine and finishes its browser OAuth headlessly. Figma accepts browser OAuth only, and Claude Code's callback is a loopback listener on the machine that runsclaude— behind bb-gate, the developer's devbox, which has no browser.Classification
no-review: strictly additive — a new optional step, a new
bb.hostentry, and new RPCs. No existing step, command, setting or default changes.What changes
plugins/team-setup/host.ts+figma.ts(new): the plugin's first host entry. It runs on the machine that runsclaude, pinsoauth.callbackPortwithclaude mcp add --transport http --scope user, startsclaude mcp login, and returns the authorization URL.figma-contract.ts(new): the server↔host contract.state/start/complete/cancel.server.ts: the step's state (optionaluntil configured,todoonce configured or while a sign-in waits,donewhen signed in,unavailablewith no machine or noclaude), thefigmaSignIn/figmaComplete/figmaCancelRPCs, and a 60 s cache around the machine state.app.tsx: the Figma row, the authorization URL, the paste-the-callback form, and the cancel/retry flow.README.md: the table row and a Figma section.package.json:bb.hostentry;enginestobb >=0.46,bbPluginSdk >=0.6.37(the host-entry API the deployed plugins already require).How the sign-in finishes
claude mcp loginrefuses to run unless stdin is a terminal (it offers the paste-the-redirect-URL prompt), so the host entry starts it underscript, which provides a pseudo-terminal and propagates the login's exit code. The developer opens the printed authorization URL on their laptop; the browser lands on a deadhttp://localhost:<port>/callback?code=…page. The step validates that pasted URL (scheme, localhost, pinned port,/callback, code, matching state) and replays it against Claude Code's own loopback listener. Only the one-time code passes through the plugin; it is useless without the PKCE verifier held by Claude Code, and the OAuth token stays in Claude Code's own store and is never read by bb.Settled before building
settingSources: ["user","project","local"]and never passes--strict-mcp-config; it only adds its own dynamic-tools server when dynamic tools are enabled. Soclaude mcp add --scope useron the machine is visible to thread sessions.bb.hostentry plusbb.hosts.experimental_client({ contract })(the same mechanism multi-repo and stewards use).Testing
npm testinplugins/team-setup: pass (63 tests; team-setup is in the CI matrix).npm run typecheck: pass.npm run build(bb plugin build): buildsdist/host.js.HOME:claude mcp addthenclaude mcp loginunderscript, parsed the authorization URL, replayed a dummy callback against the loopback listener, and the login process exited. The token exchange failed (dummy code), as expected.— from bb thread thr_5a2tjfjckb