MCP OAuth: auto-resume model turn after authentication completes

Resolved 💬 1 comment Opened Apr 21, 2026 by Vanshul97 Closed May 27, 2026

Problem

When an MCP server requires OAuth authentication, Claude calls mcp__<server>__authenticate, gets back an auth URL, and presents it to the user. The browser opens (either natively or via a PostToolUse hook), the user completes Okta/SSO login, and the MCP SDK's localhost callback receives the token silently.

However, Claude's turn has already ended. The user must manually re-type their original request (e.g., "list data stores") even though auth succeeded and the tools are now available. This is a poor UX — the user already told Claude what they wanted.

Expected Behavior

After MCP OAuth completes (localhost callback receives the auth code), Claude Code should automatically resume the model's turn so it can retry the original tool call without user intervention.

Proposed Solutions (in order of preference)

  1. Auto-resume: When the MCP SDK receives the OAuth callback, emit an internal event that resumes the model's turn with context about the original request. Claude continues as if the tool call succeeded.
  1. PostToolUse hook with auth-completion signal: Provide a hook event (e.g., McpAuthComplete) that fires when OAuth finishes, allowing plugins to trigger continuation.
  1. Built-in retry: After mcp__<server>__authenticate returns an auth URL, Claude Code could internally poll or wait for the callback, then automatically re-invoke the model with the original context.

Context

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗