UI-agnostic interaction interface for MCP OAuth login.
The OAuth login flow needs to ask the user a few things during the
handshake — open or display the authorize URL, accept a pasted callback
URL when the provider has no loopback redirect, show RFC 8628 device-code
instructions, and report success or failure. The CLI uses print and
input; a TUI surface needs in-app widgets instead. OAuthInteraction is
the small Protocol both implementations satisfy, and CliOAuthInteraction
is the existing CLI behavior preserved as one implementation of that
interface.
Important: implementations must never embed access or refresh tokens in user-facing messages. The interaction surface only ever sees authorize URLs, callback URLs, device codes, and short status strings, so leaks come from misuse, not from this interface's shape.