Skip to content

ref(mcp): Move issue and event reads onto @sentry/api - #1713

Open
sentry-junior[bot] wants to merge 2 commits into
mainfrom
feat/mcp-issues-events-sentry-api
Open

sentry-junior[bot] wants to merge 2 commits into
mainfrom
feat/mcp-issues-events-sentry-api

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Task 8.2 of the unify-sentry-api-layer change (#1669): the MCP's issue and event reads in SentryApiService now call @sentry/api operations instead of building requestJSON(apiPath...) URLs by hand.

The calls go through the existing sdkClient() bridge, the same one the organization, team, and project lists use. The SDK only builds the path and query. The MCP still owns auth, host and region routing, retries, the ApiError mapping (HTTP status kept), and Zod parsing. The bridge also rejects any URL that doesn't match the apiPath result, so path-traversal protection is unchanged. When 6.1 lands, that bridge is the one place to swap in the injected fetch. Tool output and snapshots don't change.

Events

Issues

  • listIssues, getIssue, getIssueTagValues, getIssueExternalLinks, listIssueIntegrations, and getAutofixState now use their operations. listIssues still sends query= when it's empty, because Sentry applies is:unresolved only when the parameter is missing. A new test covers this. The two link lists share a small collectAllPages walker with listIssueLinkPages, which the Sentry App lists still use. The external-issues operation has no per_page, so that call relies on Sentry's default page size of 100, which is what it used to send.

Still on requestJSON/request()

  • No @sentry/api operation: issue notes (createIssueComment, listIssueComments), getIssueActivity, getIssueUserReports, getEventCommitters.
  • Writes: updateIssue, linkNativeExternalIssue, unlinkNativeExternalIssue, unlinkSentryAppExternalIssue, startAutofix. sdkClient() only forwards GETs. Letting it forward write bodies now would be replaced by the 6.1 transport anyway. The generated types also don't fit yet: updateOrganizationIssue marks every body field required, and deleteOrganizationIssueIntegration types externalIssue as a number.
  • The attachment download (?download=1) and its redirect probe stay on request(), because they read binary data or the redirect URL rather than JSON.

The pnpm catalog moves @sentry/api from 0.420.0 to 0.423.0, the latest published version. #1712 makes the same bump, so either PR can land first. Regenerating the CLI's api-schema.json and idempotent-operations.json against 0.423.0 produced no changes.

via BYK.

--

View Junior Session in Sentry

sentry-junior Bot and others added 2 commits October 29, 2026 00:29
getEventForIssue, listEventsForIssue, and listEventAttachments now call
@sentry/api operations through the existing sdkClient bridge, which
keeps the MCP's auth, region routing, retries, ApiError mapping, and
apiPath checks. getEventAttachment reuses listEventAttachments for its
metadata lookup; the binary download stays on request().

@sentry/api sends collapse=adjacentEvents by default on
getOrganizationIssueEvent (since 0.421.0), so the hand-added query
parameter is gone. The pnpm catalog moves to 0.423.0.

listEventsForIssue no longer sends sort. Sentry's issue events endpoint
ignores it and always returns the newest events first.

Co-Authored-By: BYK <burak.kaya@sentry.io>
listIssues, getIssue, getIssueTagValues, getIssueExternalLinks,
listIssueIntegrations, and getAutofixState now call @sentry/api
operations through the sdkClient bridge. The two link lists share a
collectAllPages walker with the path-based listIssueLinkPages, which
the Sentry App installation and component lists still use.

listIssues keeps sending an empty query when none is given, because
Sentry applies is:unresolved only when the parameter is missing.

Issue writes stay on requestJSON: the bridge only forwards GETs until
the MCP transport injection lands.

Co-Authored-By: BYK <burak.kaya@sentry.io>
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sentry-local Ready Ready Preview Oct 29, 2026 12:47am UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview — 639c9ffd Deployed Oct 29, 2026 by vercel[bot]
Actions — 639c9ffd Deployed Oct 29, 2026 by sentry-junior[bot] via eval #1394
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.

0 participants