Repository navigation
feat(cli): add local MCP server command - #1401
Draft
MathurAditya724 wants to merge 10 commits into
Draft
MathurAditya724 wants to merge 10 commits into
MathurAditya724 wants to merge 10 commits into
Conversation
Start the stdio MCP server through the CLI's active, host-scoped credentials so users do not need a separate MCP login. Co-Authored-By: GPT-5 <noreply@openai.com>
Co-Authored-By: GPT-5 <noreply@openai.com>
Co-Authored-By: GPT-5 <noreply@openai.com>
Co-Authored-By: GPT-5 <noreply@openai.com>
Co-Authored-By: GPT-5 <noreply@openai.com>
Run the bundle prerequisite before parallel E2E workers so cold CI builds cannot exceed per-suite setup timeouts. Co-Authored-By: GPT-5 <noreply@openai.com>
mr-danya
pushed a commit
to mr-danya/sentry-mcp
that referenced
this pull request
Oct 6, 2026
## Summary Shared issue links use an org-scoped public endpoint that returns `id`. The CLI was calling the retired unscoped endpoint and expecting `groupID`, so valid links could not resolve. Resolve the organization from the URL or existing context, validate the shared issue ID, and fetch full details through the authenticated org-scoped API. Support canonical `/organizations/<org>/share/issue/<shareId>/` URLs alongside SaaS subdomain links. Public share requests remain unauthenticated, with existing host-scoped custom headers preserved. Legacy links without organization context now produce a context error. Supersedes getsentry#1401. ## Test plan - 380 tests passed across the shared API, issue resolver, URL/argument parsers, and host/header security suites. - All six shared-link resolver regression cases fail against the original `main` implementation and pass with this change. - Full `tsc --noEmit`, `pnpm run lint`, `pnpm run check:errors`, and `git diff --check` passed. - Generated schema/docs/SDK prerequisites completed without tracked generated changes. - No live shared-link request, full unit suite, E2E suite, or packaging build was run.
Member
|
looked at this and also tried it out. some notes:
|
Member
Author
|
Hey Jared, can you resolves these things mentioned by bete? In the previous message |
Address review feedback on the MCP command's auth handling: - Trigger the interactive login flow when `sentry mcp` starts without a usable CLI session in a TTY, matching the rest of the CLI; fall back to a clear AuthError when non-interactive (e.g. launched by an IDE). - Refresh the credential on an upstream 401 during a tool call via a new `onUpstreamUnauthorized` hook so a long-running server picks up a fresh token without a restart, mirroring `log list --follow`. - Normalize the resolved token with `normalizeAuthToken` so a malformed env token can't reach the MCP server as a broken Authorization header.
Member
Author
|
Thanks @betegon — addressed all three in 08e6ab9:
Added unit coverage for all three in |
Add regression coverage for the MCP command's lifecycle and host handling so the previously-fixed edge cases can't silently regress: - `runMcpCommand` leaves a running stdio server alone on success (no force-exit, no dispatcher close) and only tears down network resources when setup fails. - `prepareMcpServerArgs` translates a `SENTRY_HOST=https://…` origin into a plain `--host` and preserves an explicit `--host --insecure-http` over a CLI http URL. Exports `runMcpCommand` for testing, matching the existing `getMcpArgs`.
Resolve packages/cli/package.json conflict: keep the mcp-core/mcp-server prebuild prefix on build/build:all/bundle/typecheck while adopting main's oxlint/oxfmt lint commands. Reformat the MCP changes with oxfmt and replace the stale biome-ignore with an oxlint-disable directive.
Post-merge cleanup after main's biome→oxc migration: - Reformat the branch's MCP files (cli.ts, commands/mcp.ts, mcp-command.test.ts) with oxfmt so `pnpm --filter sentry lint` passes. - Bump the generated `sentry-cli-mcp` skill reference to 0.48.0-dev.0 to match the version bump merged from main (all sibling references already updated), fixing the docs drift check.
This branch has not been 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.
The Sentry CLI now starts the local stdio MCP server with
sentry mcp, using the active CLI session rather than a separate MCP login or token cache.The command preserves CLI credential host scoping, directs users to
sentry auth loginwhen needed, and keeps the standalonesentry-mcpauthentication flow unchanged.