Onboarding OAuth login requests insufficient scopes — MCPs from claude.ai unavailable until manual /login

Resolved 💬 2 comments Opened Mar 9, 2026 by alansikora Closed Apr 7, 2026

Bug Description

When launching Claude Code for the first time, the onboarding OAuth flow requests only the user:inference scope. This means the token obtained during initial setup lacks the user:mcp_servers scope (among others), so MCPs from claude.ai are not available after completing onboarding.

Running /login or claude auth login manually immediately after fixes the issue — MCPs appear instantly because both flows request the full set of scopes.

Root Cause

In the OAuth URL builder (mV1 in the bundle), the scope selection logic is:

let scopes = inferenceOnly ? ["user:inference"] : allScopes;
// allScopes = ["org:create_api_key", "user:profile", "user:inference", "user:sessions:claude_code", "user:mcp_servers"]

The onboarding flow calls startOAuthFlow with inferenceOnly: true:

// Onboarding component (~line 9545992 in cli.js bundle v2.1.71)
await z.startOAuthFlow(async (N) => {
  Y({ state: "waiting_for_login", url: N });
  // ...
}, { loginWithClaudeAi: true, inferenceOnly: true, expiresIn: 31536000 });

The /login command and claude auth login do NOT pass inferenceOnly, so it defaults to undefined (falsy), requesting all scopes:

// /login and claude auth login flow (~line 8119171 in cli.js bundle v2.1.71)
await z.startOAuthFlow(async (_) => {
  process.stdout.write(`Opening browser to sign in…\n`);
  // ...
}, { loginWithClaudeAi: true, loginHint: email, loginMethod: sso });

Impact

  • First-time users don't see MCPs from claude.ai after completing onboarding
  • The token is missing: user:mcp_servers, user:sessions:claude_code, user:profile, org:create_api_key
  • Workaround: run /login (inside REPL) or claude auth login (from terminal) to re-authenticate with full scopes

Suggested Fix

Remove inferenceOnly: true from the onboarding OAuth flow (or at minimum include user:mcp_servers in the inferenceOnly scope set).

Steps to Reproduce

  1. Start Claude Code for the first time (fresh install, no prior auth)
  2. Complete the onboarding flow (select theme, authenticate via browser)
  3. Try to use MCPs from claude.ai → they are not available
  4. Run /login or claude auth login → MCPs appear immediately

Environment

  • Claude Code version: 2.1.71
  • OS: macOS (Darwin 25.3.0, arm64)

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗