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
feat: trigger MCP OAuth for servers that need authentication
After query() initialization, check mcpServerStatus() for HTTP/SSE
MCP servers in 'needs-auth' state and trigger the Claude Code CLI's
built-in OAuth flow via the mcp_authenticate control message.
The CLI handles the full PKCE flow: RFC 9728 discovery, dynamic client
registration, localhost callback server, token exchange, and keychain
storage. The agent opens the user's browser for OAuth consent and
polls until the server transitions to 'connected'.
Browser opening mirrors the CLI's internal approach: respects $BROWSER,
uses rundll32 on Windows, open on macOS, xdg-open on Linux. In
headless environments where opening fails, the auth URL is logged as
an error and the server is skipped gracefully.
Previously, MCP servers requiring OAuth would silently fail to connect
unless the ACP client pre-injected static Authorization headers.
Validated end-to-end with Datadog and Atlassian MCP servers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments