pub enum McpAuthRequiredReason {
Required,
Expired,
InsufficientScope,
}Expand description
Why an MCP server is currently in the {@link McpServerStatus.AuthRequired} state. Mirrors the three failure modes defined by the MCP authorization spec.
Variants§
Required
No token has been provided yet (HTTP 401, no prior token).
Expired
A previously valid token expired or was revoked (HTTP 401).
InsufficientScope
Step-up auth: a token is present but its scopes are insufficient for
the requested operation (HTTP 403 with
WWW-Authenticate: Bearer error="insufficient_scope").
Unlike {@link Required} and {@link Expired} — which typically surface
before any tool work is in flight — InsufficientScope is almost
always triggered by an MCP request issued mid-turn (a tools/call,
resources/read, etc.). The host SHOULD pair the
{@link McpServerAuthRequiredState} transition with
{@link SessionStatus.InputNeeded} on
{@link SessionSummary.status | the session} so the activity becomes
visible at the session-summary level, and clients SHOULD watch for
this kind on any
{@link McpServerCustomization | MCP server} backing a running tool
call so they can present an explicit “grant more access” affordance
tied to the blocked tool call.
Trait Implementations§
Source§impl Clone for McpAuthRequiredReason
impl Clone for McpAuthRequiredReason
Source§fn clone(&self) -> McpAuthRequiredReason
fn clone(&self) -> McpAuthRequiredReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more