yera.tools.mcp.oauth_interaction
Presentation-neutral interaction contracts for MCP OAuth.
Symbols
OAuthAuthorizationRequest
Describe an OAuth authorization redirect for presentation.
The authorization URL is transient protocol state and must not be persisted or written to logs.
Attributes
Yera name of the MCP connection.
Streamable HTTP endpoint being authorized.
Discovered authorization-server issuer.
Protected OAuth resource requested by the MCP server.
OAuth scopes requested from the user.
Complete transient browser authorization URL.
OAuthAuthorizationResult
Carry transient values captured from an OAuth callback.
These values must remain in memory and must not be persisted or logged.
Attributes
Short-lived authorization code returned by the server.
State value returned for request-correlation validation.
Optional authorization-response issuer supplied under RFC 9207.
OAuthDeviceAuthorizationRequest
Describe a device-authorization verification step for presentation.
The device code is secret protocol state and is intentionally excluded.
Attributes
Yera name of the MCP connection.
Streamable HTTP endpoint being authorized.
Discovered authorization-server issuer.
OAuth scopes requested from the user.
Page at which the user enters the displayed code.
Optional link containing the user code.
Short code displayed for user verification.
Lifetime of the verification request.
OAuthDeviceInteraction
ProtocolPresent a device-authorization verification step to the user.
Methods
OAuthDeviceInteraction.present_device_authorization
present_device_authorization(
request: OAuthDeviceAuthorizationRequest,
) → NonePresent device verification instructions.
Parameters
Non-secret verification context to present.
OAuthInteraction
ProtocolPresent OAuth authorization and capture its callback result.
Methods
OAuthInteraction.present_authorization
present_authorization(
request: OAuthAuthorizationRequest,
) → NonePresent an authorization request to the user.
Parameters
Transient authorization context to present.
OAuthInteraction.await_callback
await_callback() → OAuthAuthorizationResultWait for the authorization server callback.
Returns
The captured authorization code and state.