CLI tests write the developer's real ~/.mcp-inspector OAuth state file (oauth-runner, programmatic-ergonomics)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 62/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- nodejs, typescript
- 领域
- testing-qa
调研方向
Start with clients/cli/__tests__/oauth-runner.test.ts and programmatic-ergonomics.test.ts, then read core/auth/node/storage-node.ts to see how it resolves the state path from homedir() and MCP_INSPECTOR_OAUTH_STATE_PATH. Follow the #2677 approach for the web integration project to add a CLI setup file that points those variables at a per-file temp dir, plus a guard that fails if the path is outside tmpdir. Done when the repro loop in the issue leaves no oauth.json* files under the scratch HOME.
由索引模型根据 Issue 内容生成。
描述
Problem
Two clients/cli test files write the developer's real ~/.mcp-inspector/storage/oauth.json (and oauth.json.namespaces.json): __tests__/oauth-runner.test.ts and __tests__/programmatic-ergonomics.test.ts. This is the same bug #2670 / PR #2677 fixed for the web integration project, now in the CLI suite, which has no equivalent isolation.
It was found during the v2.11.0 milestone smoke (#2718). The real store's mtime moved to 23:11:58 while coverage:cli was running (23:11:51–23:12:02) inside npm run local:gate.
It predates 2.10.1: both files are unchanged in the relevant respect since that tag. It is test-only and does not ship in the package, so it does not block 2.11.0.
Reproduce
Run each CLI test file with HOME pointed at an empty scratch dir. core/auth/node/storage-node.ts falls back to homedir() when MCP_INSPECTOR_OAUTH_STATE_PATH is unset:
cd clients/cli
for f in oauth-runner programmatic-ergonomics stored-auth e2e; do
H=$(mktemp -d); HOME=$H npx vitest run __tests__/$f.test.ts >/dev/null 2>&1
echo "$f: $(find $H -name 'oauth.json*' | sed "s#$H#~#" | tr '\n' ' ')"
done
Observed on the v2.11.0 tree:
oauth-runnerandprogrammatic-ergonomicsboth create~/.mcp-inspector/storage/oauth.jsonandoauth.json.namespaces.json.- The other ten OAuth-touching CLI test files are clean.
Expected
No CLI test reads or writes the developer's real OAuth state.
The fix is the #2677 shape: a CLI setup file that points MCP_INSPECTOR_OAUTH_STATE_PATH (and whatever else storage-node.ts resolves from home) at a per-file temp dir, plus a guard that fails if the resolved path is outside tmpdir. That also stops concurrent worktree gates racing on one shared file.
- 主要语言
- TypeScript
- 星标
- 11.1k
- 派生
- 1.5k
- 平均合并
- 4 小时 28 分钟
- 30 天内合并 PR
- 151
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/inspector 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/inspector#2723 · 1 条评论 ·
维护者通常 1 天内回复
-
insufficient_scope challenge retry doesn't detect expired access token, gives up after one identical retry可能已有人在做 @its-nott-me 于 1 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 50/100
modelcontextprotocol/inspector#2724 · 2 条评论 ·
维护者通常 1 天内回复
-
Modern subscriptions: a subscriptions/listen refused with HTTP 403 is retried eight times in silence未关闭bug v2
难度 4/5 3-5 天 新手友好度 30/100
modelcontextprotocol/inspector#2722 · 1 条评论 ·
维护者通常 1 天内回复
-
bug v2
难度 3/5 1-2 天 新手友好度 50/100
modelcontextprotocol/inspector#2721 · 2 条评论 ·
维护者通常 1 天内回复
-
chore v2
难度 4/5 3-5 天 新手友好度 48/100
modelcontextprotocol/inspector#2715 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/inspector 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
Chocobozzz/PeerTube#7832 ·
维护者通常 3 天内回复
-
Pay to use?未关闭
难度 1/5 1 小时以内 新手友好度 66/100
darkreader/darkreader#16108 · 1 条评论 ·
维护者通常 2 天内回复
-
check:passed streams:add
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复
-
bug engine
难度 2/5 1-3 小时 新手友好度 86/100
frostney/GocciaScript#1746 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
agilepathway/label-checker#739 · 4 条评论 ·
维护者通常 1 天内回复