whoami returns a bare HTTP 400 when the token has no user behind it (org auth tokens)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 75/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- api, authentication
调研方向
阅读 packages/mcp-core/src/internal/error-handling.ts,追踪 whoami 如何处理来自 /auth/ 的 400 响应。更新此情况下显示的错误,说明该令牌没有关联的用户,并建议使用个人令牌或 OAuth。当错误提供了这些指导,且现有的通用处理方式仍适用于其他错误时,即为完成;issue 未指定测试文件。
由索引模型根据 Issue 内容生成。
描述
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.
--
- 主要语言
- TypeScript
- 星标
- 975
- 派生
- 189
- 平均合并
- 19 小时 57 分钟
- 30 天内合并 PR
- 542
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getsentry/toolkit 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
getsentry/toolkit#2583 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
getsentry/toolkit#2531 · 1 条评论 ·
维护者通常 1 天内回复
-
mcp-feedback-pattern
难度 2/5 1-3 小时 新手友好度 74/100
getsentry/toolkit#2458 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
getsentry/toolkit#2444 · 1 条评论 ·
维护者通常 1 天内回复
-
mcp-feedback-pattern
难度 2/5 1-3 小时 新手友好度 67/100
getsentry/toolkit#2362 · 1 条评论 ·
维护者通常 1 天内回复
查看 getsentry/toolkit 的全部 Issue
相似的 Issue
-
sumHorizontal, maxHorizontal, minHorizontal, allHorizontal, anyHorizontal, struct and argSortBy treat strings as literals instead of column names可能已有人在做 @tomaionescu 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
pola-rs/nodejs-polars#486 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
jaegertracing/jaeger-ui#4853 ·
维护者通常 1 天内回复
-
area/plugins platform/linux reproduced type/bug version/v2
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#66970 · 3 条评论 ·
维护者通常 1 天内回复
-
area:tui enhancement platform:macos
难度 2/5 1-3 小时 新手友好度 68/100
anthropics/claude-code#112838 ·
-
approved check:passed streams:add
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复