Repository navigation
Conversation
The MCP step of the setup flow wrote a posthog server into every detected coding agent's user-wide config right after the outro, with no question. McpScreen now takes a confirmInstall prop. The setup flow sets it: the screen lists the detected agents and offers Add or Skip (esc also skips) before it touches any config. Skipping completes the step as skipped and still goes on to the AI assistants step when there is one. mcp add leaves the prop off, since running that command is the request.
A quick word from the signature departmentHey @Ankur1911, thanks for the PR! GitHub couldn't verify the signature on this commit:
PostHog requires verified commit signatures before merging. So we've built a bot to do the nagging. You're talking to it. Let's get this verifiedIf signing isn't set up yet, follow our signing guide or GitHub's guide. Already signed? Make sure GitHub recognizes your key. SSH keys must be registered as a Signing Key, not only as an Authentication Key. Once signing is set up, if the unsigned commit is your latest commit, run: git commit --amend --no-edit -S
git push --force-with-leaseThose commands fix only your latest commit. Older unsigned commits need signing too. Coordinate with anyone else using the branch before rewriting its history. Save your future self another visit from me: git config --local commit.gpgsign trueThat enables signing for future commits; it doesn't sign existing ones. A I'll check again after your next push and update this comment. |
Problem
The setup flow's MCP step installs the PostHog MCP into every detected coding agent without asking. After the outro it goes straight from
detectClients()toinstallAll(local)and writes aposthogserver into each agent's user-wide config (for example VS Code's user-levelmcp.json), outside the project the wizard was pointed at. Only the remove flow has an ask phase, and the AI-assistants step already lets the user skip, so the two steps behave differently.Closes #1620
Changes
McpScreentakes a newconfirmInstallprop. When set, install mode stops in the existingPhase.Askafter detection, lists the detected coding agents and offers "Add the PostHog MCP" or "Skip". Nothing is written until the user picks Add.escalso skips.McpOutcome.Skipped, and goes on to the AI-assistants step when the user has account clients (the outcome is kept, so leaving that step reportsskippedwith no installed clients).ScreenId.Mcpscreen, the one the setup flow shows, setsconfirmInstall.mcp addleaves it off: running that command is the request, so it installs straight away as before.mcp removeis unchanged.Left out on purpose: a
--no-mcpflag or env variable for scripted runs (also suggested in the issue). The TUI is the only host that shows this step, so I kept this to the prompt; happy to add the flag in a follow-up if you want it.Test plan
src/tui/__tests__/mcp-screen-outcome.test.tsx: four new tests. WithconfirmInstallthe installer is not called until the user agrees; Add installs and shows the results; Skip and esc install nothing and complete asskippedwith onemcp completeevent; after Skip the AI-assistants step is still offered and completes asskipped. The existing install tests (noconfirmInstall) are unchanged and pass.e2e-harness/__tests__/keyboard-equivalence.test.tsx: the MCP pair now types Enter twice (agree, then leave the results); a new pair covers esc againstset_mcp_outcomewithskipped.frames/mcp-*.txtsnapshots updated: the setup flow's MCP screen now opens on the question.pnpm typecheckclean,pnpm lint0 errors (existing warnings only),vitest run4846 passed. Under full-suite load a few timing-sensitive tests (cli.test.ts--region,wizard-ci-driver,run-offer-delivery,migrated-from) time out intermittently; each passes when run alone, with and without this change.pnpm build/ the smoke tests, and a real install into editors on a desktop (the screen is tested against a fake installer).