Skip to content

feat(cli): Add --mcp/--no-mcp to answer the wizard's MCP question - #2789

Merged
BYK merged 2 commits into
mainfrom
feat/wizard-mcp-flag
Dec 2, 2026
Merged

BYK merged 2 commits into
mainfrom
feat/wizard-mcp-flag

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Every sentry wizard flow (Next.js, React Native, iOS, Android, and the rest) ends with offerProjectScopedMcpConfig, which asks whether to add a project-scoped MCP server configuration. No flag answered it, so since #2652 a run without a terminal (CI, a coding agent's shell, < /dev/null) stopped at this last question with exit code 1, after all its changes were made, even when flags answered every other question.

This adds an mcp entry to WIZARD_ANSWER_FLAGS, so sentry wizard gets --mcp/--no-mcp and their help text like the other answer flags. With --no-mcp, non-interactive wizard runs now finish with exit code 0.

  • offerProjectScopedMcpConfig answers its first question through answerOrAsk("mcp", …). --no-mcp skips the MCP setup; --mcp goes straight to the editor multiselect. Either way the answer is logged, as for the other flags.
  • With neither flag, the Yes / No / What is MCP? prompt is asked as before, including the follow-up question after the explanation. Its wording now comes from the mcp entry (answerFlagQuestion), so the prompt, --help and the log line show the same question.
  • The mcp-choice and mcp-configured tags are kept and are also set from the flag's answer (mcp-choice is yes/no then).
  • The editor multiselect after a yes still has no flag: --mcp is for interactive runs, and --no-mcp is what non-interactive runs need.
  • The wizard docs fragment says the wizard ends with the MCP question and that --no-mcp lets runs without a terminal finish; the generated skill reference lists the new flag.

via Antonis Lilis.

--

View Session [Sentry]

Every wizard flow ends with the project-scoped MCP server question, and no
flag answered it, so a run whose input had ended stopped there with exit
code 1 after all its changes were made. --no-mcp skips the MCP setup and
--mcp goes on to the editor question; with neither, the three-choice
prompt is asked as before.

Co-Authored-By: Antonis Lilis <antonis.lilis@sentry.io>
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Dec 2, 2026 1:25pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Dec 2, 2026 1:25pm UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – sentry-local December 2, 2026 13:24 Inactive
@sentry-junior
sentry-junior Bot marked this pull request as ready for review December 2, 2026 13:38
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Dec 2, 2026
@antonis
antonis marked this pull request as draft December 2, 2026 13:45
@antonis

antonis commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Tested end to end with the packed npm build of a local branch: main (9116f43) plus #2790, #2791, #2792 and this PR, merged in that order (216f4fb2f). Xcode 27.2. The projects are fresh Xcode 16+ "App" template projects in their pre-wizard state, against sentry-sdks/sentry-cocoa.

sentry wizard sentry-sdks/sentry-cocoa ios --logs --no-mcp < /dev/null:

Project Exit code End of output
iOS SwiftUI, one target, no Fastfile 0 ● MCP server configuration: no (--no-mcp), then "Sentry was successfully added to your project!"
iOS UIKit (Objective-C), one target, with a Fastfile 1, as expected stops at "Found a Fastfile in your project. Do you want to configure a lane…?" with "The wizard needs an answer to this question, but its input ended…"
  • --no-mcp answers the last question, so a run without a terminal now finishes on a project without a Fastfile.
  • In the Objective-C run, everything before the Fastfile question was applied: the upload build phase, the sentry-cocoa package, the snippet in AppDelegate.m, and .sentryclirc plus its .gitignore entry. The Fastfile was left unchanged.
  • sentry wizard --help lists --mcp and --no-mcp.

The Fastfile question is the last one in the Apple wizard without a flag.

@antonis
antonis requested a review from BYK December 2, 2026 13:48
@antonis
antonis marked this pull request as ready for review December 2, 2026 13:48

@antonis antonis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BYK since this is a behavioral change adding you as a reviewer 🙇

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove that last step at this point but approving this one for consistency and completeness of the rest. Thanks for the sharp eyes!

@BYK
BYK added this pull request to the merge queue Dec 2, 2026
@sentry-junior

sentry-junior Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @BYK. Removing the MCP step entirely is a separate change, so I'm leaving it out of this PR. It would also make --mcp/--no-mcp unnecessary, so whoever takes it on should drop the mcp entry from WIZARD_ANSWER_FLAGS along with offerProjectScopedMcpConfig.

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — ea8c4e40 Deployed Dec 2, 2026 by vercel[bot]
Preview – sentry-local — ea8c4e40 Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants