TUI tests append to the developer's real ~/.mcp-inspector/auth.log (App.test.tsx mounts the real getTuiLogger)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- nodejs, typescript
- 領域
- testing
調査の方向性
clients/tui/src/logger.ts から始めてください。ここでは getTuiLogger() が MCP_INSPECTOR_LOG_DIR または HOME からディレクトリを解決します。また __tests__/App.test.tsx も確認してください。こちらは App をマウントし、その呼び出しを発生させます。空の一時ディレクトリを HOME に設定してそのファイルを実行し、.mcp-inspector/auth.log が存在するかを確認して再現してください。vitest.config.ts にある既存の MCP_INSPECTOR_SECRET_STORE の固定設定に倣い、ファイルごとの一時ディレクトリを MCP_INSPECTOR_LOG_DIR に設定するセットアップファイルを作成してください。一時的な HOME で実行してもその下にログが作られず、logger.test.ts が引き続き通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Bug report
Which version line? v2 — current
Which client? TUI
Inspector version: 2.11.0 (v2/main @ 074b8108)
Node version: v24.20.0
Operating system: Linux (also applies anywhere HOME resolves)
Transport: Not applicable / never connected
Problem
The TUI test suite writes to the developer's real ~/.mcp-inspector/auth.log. clients/tui/src/logger.ts's getTuiLogger() is a lazy singleton that resolves its log directory from MCP_INSPECTOR_LOG_DIR ?? HOME/.mcp-inspector, and __tests__/App.test.tsx mounts App, which calls getTuiLogger() on startup — so a normal test run appends ~155 lines of test noise ("msg":"TUI started", test-process pid/hostname) to the real log. Concurrent worktree gates interleave into the same file. This is the same class of bug as #2670 / #2719 (tests touching the real ~/.mcp-inspector), one directory up: the log file rather than the OAuth state.
logger.test.ts itself is clean — it tests each resolution arm with vi.resetModules(), per-test env save/restore, and a temp HOME. The leak comes from the app-mounting suites, which never set the override.
Reproduce
Point HOME at an empty scratch dir and run the suite; the log file appears under the scratch home:
cd clients/tui
H=$(mktemp -d)
HOME=$H npx vitest run __tests__/App.test.tsx
find $H -name 'auth.log' # → $H/.mcp-inspector/auth.log, ~155 lines of {"msg":"TUI started",...}
Scope checked (same scratch-HOME sweep)
- All 49
clients/tui/__tests__files swept individually: onlyApp.test.tsxleaks; the rest are clean. clients/mcpdoOAuth-touching suites (connection-stored-auth,daemon-connections,ema,ema-login-helper,mcp-auth-coverage) are clean — they setMCP_INSPECTOR_OAUTH_STATE_PATHper test.clients/launcherhas no storage-touching tests.clients/webunit tests use a recording backend for OAuth persistence (integration was isolated in #2677).
Expected
No TUI test reads or writes the developer's real ~/.mcp-inspector/auth.log.
Suggested fix shape
The #2677 shape, one directory over: a TUI vitest setup file that pins MCP_INSPECTOR_LOG_DIR at a per-file mkdtemp directory (plus a guard that fails if the resolved path escapes tmpdir). logger.test.ts's fallback-arm cases are unaffected — they delete the variable and set their own HOME per test with a fresh module import. The tui project already pins MCP_INSPECTOR_SECRET_STORE: "memory" in vitest.config.ts; this would be the log-dir counterpart.
Actual behavior
~/.mcp-inspector/auth.log is created/appended on the developer's real home directory on every tui test run that mounts App.
I searched existing issues and this is not a duplicate (nearest are #2670 / #2719, which cover the OAuth state file, not the TUI log). This is not a security vulnerability report.
- 主要言語
- TypeScript
- スター
- 11.1k
- フォーク
- 1.5k
- 平均マージ
- 4時間 14分
- マージ済み PR(30日)
- 162
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/inspector のほかの issue
-
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 日以内に返信
-
bug v2
難易度 3/5 半日 初心者へのやさしさ 62/100
modelcontextprotocol/inspector#2719 ·
メンテナーはふだん 1 日以内に返信
-
chore v2
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
modelcontextprotocol/inspector#2715 ·
メンテナーはふだん 1 日以内に返信
-
enhancement v2
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
modelcontextprotocol/inspector#2705 ·
メンテナーはふだん 1 日以内に返信
modelcontextprotocol/inspector の issue をすべて見る
似ている issue
-
enhancement good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
OWASP/cve-lite-cli#1335 ·
メンテナーはふだん 1 日以内に返信
-
Windows: main-screen mouse tracking requires WT_SESSION, so it never enables inside herdr panesオープン
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
code-yeongyu/senpi#3353 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Channels status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
mastra-ai/mastra#27093 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement needs-triage ui
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信