Skip to content

Commit adf41d3

Browse files
cliffhallclaude
andcommitted
docs(core): scope MCP_STORAGE_DIR comment in getStateFilePath to the OAuth backend
Address review of PR #1651: the doc comment claimed MCP_STORAGE_DIR was honoured "across the app, so setting it once points every persist backend at the same directory", but the branch only relocates oauth.json. Narrow the comment to state it is OAuth-backend-only (client.json/mcp.json still resolve from getDefaultStorageDir → HOME) and record why the resolution lives here rather than in getDefaultStorageDir (the default-path constant is evaluated at module load, so a runtime-set MCP_STORAGE_DIR — as the CLI stored-auth / --wait-for-auth flows set it — must be read at call time). Comment-only; no behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
1 parent af93599 commit adf41d3

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎core/auth/node/storage-node.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@ const DEFAULT_STATE_PATH = getStoreFilePath(getDefaultStorageDir(), "oauth");
1515
* 2. `MCP_INSPECTOR_OAUTH_STATE_PATH` — the per-file override (so tests and
1616
* scripted runs can point at an isolated fixture without touching
1717
* `~/.mcp-inspector`)
18-
* 3. `<MCP_STORAGE_DIR>/oauth.json` — the storage-directory override honoured
19-
* across the app, so setting it once points every persist backend at the
20-
* same directory
18+
* 3. `<MCP_STORAGE_DIR>/oauth.json` — the storage-directory override for the
19+
* OAuth state file specifically, so the CLI's stored-auth flows and the web
20+
* backend agree on where `oauth.json` lives when the env var is set. Note
21+
* this branch scopes `MCP_STORAGE_DIR` to the OAuth backend only; it does
22+
* NOT relocate `client.json` / `mcp.json` (those still resolve from
23+
* `getDefaultStorageDir()`, which reads `HOME`/`USERPROFILE`). Resolving it
24+
* here (rather than in `getDefaultStorageDir()`) is deliberate: the default
25+
* path constant above is evaluated at module load, so a runtime-set
26+
* `MCP_STORAGE_DIR` — how the CLI stored-auth tests and the `--wait-for-auth`
27+
* flow set it — is only honoured by reading the env var at call time.
2128
* 4. the default `~/.mcp-inspector/storage/oauth.json`
2229
*/
2330
export function getStateFilePath(customPath?: string): string {

0 commit comments

Comments
 (0)