Repository navigation
ref(mcp): Always send MCP telemetry to the CLI's project - #1969
Merged
Merged
Conversation
Remove the --sentry-dsn flag and the SENTRY_DSN/DEFAULT_SENTRY_DSN reads from `sentry mcp` and @sentry/mcp-server. An MCP server started from a project shell or IDE inherited the app's SENTRY_DSN and sent its telemetry to the user's own Sentry project. Telemetry now always goes to SENTRY_CLI_DSN, and only the CLI's opt-outs (SENTRY_CLI_NO_TELEMETRY=1, DO_NOT_TRACK=1, `sentry cli defaults telemetry off`) turn it off. Breaking: --sentry-dsn is now an unknown flag, so a config that passes it fails to start. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
approved these changes
Nov 4, 2026
BYK
enabled auto-merge (squash)
November 4, 2026 23:01
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove every way to override the DSN for the server's own telemetry in
sentry mcpand@sentry/mcp-server:--sentry-dsnflag;SENTRY_DSNandDEFAULT_SENTRY_DSNenv reads;sentryDsnconfig plumbing.MCP telemetry now always goes to
SENTRY_CLI_DSN. Only the CLI's telemetry opt-outs decide whether it's on.SENTRY_DSNis the variable people set for their own apps. An MCP server started from a project shell or IDE inherited it and sent our telemetry to the user's own Sentry project.The override dates back to #120 (Apr 2025), which added Sentry to the original stdio package with
--sentry-dsn/SENTRY_DSN. In that design, an empty--sentry-dsn=was the documented opt-out. #1401 (sentry mcp) and #1731 (the slim@sentry/mcp-serverbundle) carried it over.Key changes
packages/cli/src/lib/mcp/:args.tsdrops the flag type, the env reads and the merge.config.tsdropssentryDsn.server.tsalways callsinit({ dsn: SENTRY_CLI_DSN, enabled: isTelemetryEnabled() }).--sentry-dsn=is gone, and so is the rule that an explicit DSN ignored the CLI opt-out.commands/mcp.ts: the--sentry-dsnflag and theSENTRY_DSNhelp line are removed. The skill reference is regenerated withgenerate:skill.mcp-test-client: stops passing--sentry-dsnandSENTRY_DSNto the server it launches. Its own--sentry-dsn, for the test client's own Sentry client, stays, with a clearer description.mcp-core/tsdown.config.ts: drops the unusedDEFAULT_SENTRY_DSNdefine. Nothing in mcp-core reads it; it was the old stdio package's build-time DSN.docs/operations/monitoring.md,docs/testing/stdio.md,TELEMETRY.md, the mcp-core README and the stdio setup page now point to the opt-out instead.VITE_SENTRY_DSNis unchanged. That's deployment config, not a user override.Breaking changes
For
@sentry/mcp-serverandsentry mcpusers:--sentry-dsnis now an unknown flag. A config that passes it, including the documented opt-out--sentry-dsn=, fails before the server starts. I checked on the rebuilt bundle (node dist/sentry-mcp.cjs --sentry-dsn=and--sentry-dsn=https://…): stderr showsNo flag registered for --sentry-dsnand the exit code is 252.SENTRY_DSNandDEFAULT_SENTRY_DSNare silently ignored. Anyone who used them to send MCP telemetry to their own Sentry instance now reports to the Sentry CLI's project instead.Migration: remove
--sentry-dsnfrom the MCP config. To turn telemetry off, setSENTRY_CLI_NO_TELEMETRY=1orDO_NOT_TRACK=1in the server'senv, or runsentry cli defaults telemetry offonce (shared config dir).{ "command": "npx", "args": ["@sentry/mcp-server@latest"], "env": { "SENTRY_CLI_NO_TELEMETRY": "1" } }computeTelemetryEffective()inpackages/cli/src/lib/telemetry.tschecks the env vars for an exact"1", then the stored preference.Release note: the title has no
!..craft.ymluseschangelog.policy: autoandversioning.policy: auto, there's no.github/release.yml, and Craft's default categories maptype!:to a major bump. A!would most likely cut CLI 1.0.0 (inferred from Craft's docs, not tried).docs/releases/stdio.mdhas no separate breaking-change process for@sentry/mcp-server, which ships at the CLI's version. Please call out the break in the release notes, or add!if a major bump is intended.Tests
test/lib/mcp/telemetry.test.ts:SENTRY_CLI_DSN;SENTRY_CLI_NO_TELEMETRY=1andDO_NOT_TRACK=1each disable it;SENTRY_DSNandDEFAULT_SENTRY_DSNset in the env, the DSN is still the CLI's (the env leak behind this change).test/lib/mcp/args.test.ts:parseMcpEnvignores both env vars, and--sentry-dsn=is rejected.packages/mcp-server/test/bundle.test.mjs:--sentry-dsn=;SENTRY_CLI_NO_TELEMETRY=0and sends it to a deadhttps_proxy, so nothing leaves the machine.Screenshot
The stdio setup page (
packages/mcp-cloudflare,?transport=stdio), from a localvite build:Interaction with #1963
#1963 stacks the offline telemetry store on #1960. It gates the store in
mcp/server.tsonuseCliDsn, which is true only without an override. Once this merges, that gate is always true and becomes dead code. Whichever PR lands second removes it and always uses the store.via @BYK.
--
View Session in Sentry