You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Web integration tests read and write the developer's real ~/.mcp-inspector OAuth state file #2670
clients/web/src/test/integration/auth/node/storage.test.ts and clients/web/src/test/integration/helpers/oauth-client-fixtures.ts construct NodeOAuthStorage() / call getStateFilePath() with no path and with neither MCP_INSPECTOR_OAUTH_STATE_PATH nor MCP_STORAGE_DIR set, so they resolve to DEFAULT_STATE_PATH — the real ~/.mcp-inspector/storage/oauth.json of whoever runs the suite.
Two consequences:
It touches real user state.clearAllOAuthClientState() in "clearAllOAuthClientState clears every server in the default store" clears every server in that file, and the suites rewrite it and its oauth.json.namespaces.json ledger. A developer who uses the Inspector on the same machine can lose their stored OAuth state by running npm run local:gate. Observed: both files' mtimes moved to the minute the gate's integration project ran.
It flakes the gate. Every forks-pool worker that reaches the default path, and any other Inspector process or worktree session on the machine, shares that one file. During local:gate on Mixing 2.9.x and 2.10 on one OAuth state file strands a confidential DCR client's secret #2630 that test failed once (expected { access_token: 'a', … } to be undefined at storage.test.ts:595, so clear never saw server-a in the file it read) and then passed 3/3 in isolation, both with and without that branch's change.
Reproduce
Note the mtime of ~/.mcp-inspector/storage/oauth.json.
cd clients/web && npx vitest run --project integration src/test/integration/auth/node/storage.test.ts
The mtime has moved, and the file now holds the tests' http://server-*.test entries, or none of yours.
Expected
No test reads or writes anything under the developer's real home directory. The integration project (or these suites) should point MCP_STORAGE_DIR / MCP_INSPECTOR_OAUTH_STATE_PATH at a per-worker temp directory, and a test that exercises default-path resolution should assert the resolved path rather than write to it.
Activity
cliffhall commentedon Oct 12, 2026
Triage: Priority Medium (total 8)
buglabel, +1 milestoned (filed through the create flow)Board: #28, Status
Todo.test(web): make the default-store isolation check a beforeEach guard (#…
test(web): isolate integration OAuth state from ~/.mcp-inspector (#2670)
test(web): make the default-store isolation check a beforeEach guard (#…
Merge pull request #2677 from modelcontextprotocol/v2/fix/2670-isolat…
cliffhall commentedon Oct 12, 2026
Shipped in #2677 (merged to v2/main as 7c75f11).