Skip to content

fix(mcp): Limit sentry mcp --commands sessions to their target - #2554

Draft
sentry-junior[bot] wants to merge 1 commit into
feat/cli-first-mcp-executefrom
fix/mcp-commands-limit-to-target
Draft

sentry-junior[bot] wants to merge 1 commit into
feat/cli-first-mcp-executefrom
fix/mcp-commands-limit-to-target

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Refs #2237. Based on #1922.

The scope fix for #2237 (#2527 → #2541 → #2549 → #2552) moved off #1922 onto main. This PR keeps the parts that only make sense with #1922's sentry mcp --commands surface:

  • The stdio runner (packages/cli/src/lib/mcp/command-surface.ts) passes limitToTarget: true to createSentrySDK(), so the session's org and project are a limit, not only defaults.
  • mcp-core constraints.ts notes that an ID alone (a numeric issue ID, an event, trace or replay ID) names no project, so the runner checks what it finds.
  • The --commands section of docs/architecture/overview.md describes the transport scope and the x-sentry-project-scope declarations.

limitToTarget and the transport scope come from #2527–#2552, which #1922 doesn't have yet. Keep this a draft until they land on main and #1922 picks them up.

via @BYK.

--

View Session [Sentry]

The `--commands` pieces of the scope fix for #2237, split out when the
rest of the stack moved off #1922 onto `main`:

- The stdio runner passes `limitToTarget: true` to the CLI SDK, so the
  session's org and project are a limit, not only defaults.
- The command-surface constraints note that an ID alone (a numeric issue
  ID, an event, trace or replay ID) is checked by the runner.
- `command-surface-scope.test.ts` runs the commands of a project-scoped
  session against a mocked Sentry API and checks each kind of ID.
- The architecture overview describes what the transport scope does for
  a `--commands` session.

These need `limitToTarget` and the transport scope from the stack that
starts at #2527, so they build once #1922 has that stack.

Refs #2237

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cli Error Error Nov 27, 2026 11:58am UTC
sentry-local Ready Ready Preview Nov 27, 2026 11:58am UTC

Request Review

This branch had an error being deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant