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
Flaky: OAuth storage test clears the real ~/.mcp-inspector store, racing other worktrees #2668
clients/web/src/test/integration/auth/node/storage.test.ts › NodeOAuthStorage with custom storagePath › clearAllOAuthClientState clears every server in the default store constructs new NodeOAuthStorage() with no path and calls clearAllOAuthClientState(). With no MCP_INSPECTOR_OAUTH_STATE_PATH or MCP_STORAGE_DIR set (no test config sets either), both resolve to DEFAULT_STATE_PATH — ~/.mcp-inspector/storage/oauth.json, the real store (core/auth/node/storage-node.ts:14).
FAIL |integration| clients/web/src/test/integration/auth/node/storage.test.ts > NodeOAuthStorage with custom storagePath > clearAllOAuthClientState clears every server in the default store
AssertionError: expected { access_token: 'a', …(1) } to be undefined
595| expect(await storage.getTokens("http://server-a.test")).toBeUndefined();
Run alone, the file passed 5/5, and the next gate's coverage stage was green.
Running the suite wipes the developer's real Inspector OAuth state.clearAllOAuthClientState() on the default store clears every server's saved tokens and client registrations, not just the test's.
Reproduce
Needs concurrency: run the web integration project in two worktrees at the same time, or save a real OAuth login in the Inspector, then run this file and see that it's gone.
Expected
The test exercises the "default store" code path without touching the real one: point the default at a per-test temp directory (e.g. set MCP_STORAGE_DIR to a mkdtemp dir in beforeEach and restore it in afterEach, resetting the storage cache), so no test ever reads or writes ~/.mcp-inspector. Worth checking whether any other test in that file or elsewhere also hits DEFAULT_STATE_PATH.
Priority score
Severity 4 (the pre-push gate goes red on unrelated diffs, and running the suite deletes a developer's real saved OAuth state) + Urgency 3 (wanted this milestone; it reddens local:gate) + bug+1 = 8 → Medium.
Duplicate of #2670. The fix is PR #2677, which is now linked to close this issue too. Its setup forces MCP_INSPECTOR_OAUTH_STATE_PATH to a per-file temp dir, which covers every default-store caller found here: storage.test.ts, helpers/oauth-client-fixtures.ts, and the inspectorClient-oauth-e2e / -ema-e2e suites that call clearAllOAuthClientState(). Note: while I checked this, a concurrent web suite in another worktree rewrote the real ~/.mcp-inspector/storage/oauth.json, which confirms the race.
Activity
cliffhall commentedon Oct 12, 2026
Duplicate of #2670. The fix is PR #2677, which is now linked to close this issue too. Its setup forces
MCP_INSPECTOR_OAUTH_STATE_PATHto a per-file temp dir, which covers every default-store caller found here:storage.test.ts,helpers/oauth-client-fixtures.ts, and theinspectorClient-oauth-e2e/-ema-e2esuites that callclearAllOAuthClientState(). Note: while I checked this, a concurrent web suite in another worktree rewrote the real~/.mcp-inspector/storage/oauth.json, which confirms the race.