whoami returns a bare HTTP 400 when the token has no user behind it (org auth tokens)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- api, authentication
Research direction
Read packages/mcp-core/src/internal/error-handling.ts and trace how whoami handles a 400 response from /auth/. Update the error shown for this case to explain that the token has no associated user and recommend a personal token or OAuth. Done when the error gives that guidance while the existing generic handling remains suitable for other errors; the issue names no test file.
Written by the indexing model from the issue text.
Description
An agent connected to the hosted MCP with a direct Sentry-Bearer token got 403s naming org:read on find_organizations and find_projects and event:read on search_issues, and then whoami failed with a bare HTTP 400 Bad Request. It concluded the token "has no usable scopes" and stopped. Reported through submit_feedback_to_sentry_team (MCP 0.42.0).
Likely token type (inference: we can't see the token). These failures fit an org auth token (sntrys_...):
- Org auth tokens carry only
org:ci. It's the only allowed scope (sentrysrc/sentry/models/orgauthtoken.py:32-36), so every read tool gets aninsufficient_scope403. Since getsentry/toolkit#2222, the MCP names the missing scopes correctly. - Org auth tokens authenticate with no user (
OrgAuthTokenAuthenticationpassesNoneas the user, sentrysrc/sentry/api/authentication.py:751-787).GET /api/0/auth/then returns a bodiless 400 whenrequest.userisn't authenticated (sentrysrc/sentry/api/endpoints/auth_index.py:63-65).
MCP gap. whoami passes that 400 through the generic Input Error template ("There was an HTTP 400 error... trying again", packages/mcp-core/src/internal/error-handling.ts). That message doesn't tell the agent the token isn't tied to a user, or that org auth tokens can't drive the MCP.
Fix. whoami should explain a 400 from /auth/: the token isn't tied to a user, org auth tokens only carry org:ci, so connect with a personal token or OAuth.
Possible follow-up, not in the fix: reject sntrys_ tokens up front in Sentry-Bearer mode, since no read tool can work with org:ci alone.
Reports: 1
via automation evt_905b9c478746fd9deeb853f85ad7441b · Run ID dispatch_d428b39c5339ad27cbfcee6c1a8f7e77.
--
- Dominant language
- TypeScript
- Stars
- 975
- Forks
- 189
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 571
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsentry/toolkit
-
Rejected regionUrl errors don't say how to recover when an agent passes the organization's web URLOpenmcp-feedback-pattern
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
getsentry/toolkit#2777 · 1 comment ·
Maintainers usually reply within 1 day
-
mcp-feedback-pattern
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
getsentry/toolkit#2458 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
getsentry/toolkit#2444 · 1 comment ·
Maintainers usually reply within 1 day
-
mcp-feedback-pattern
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
getsentry/toolkit#2362 · 1 comment ·
Maintainers usually reply within 1 day
-
link_issue passes through a misleading 404 when an integration token lists Sentry App installationsOpenmcp-feedback-pattern
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
getsentry/toolkit#2295 · 1 comment ·
Maintainers usually reply within 1 day
All issues in getsentry/toolkit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
effort/l priority/p1 risk/high triage/core
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
iflytek/skillhub#1188 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Fission-AI/OpenSpec#2337 ·
Maintainers usually reply within 1 day