Overview
Auth errors are thrown when authentication or authorization fails at the request level. These are public errors that inform clients about what action is needed (re-authenticate, authorize an app, etc.). For internal auth infrastructure errors, see Auth Internal Errors.Error Reference
UnauthorizedError
Thrown when a request is missing valid credentials.AuthConfigurationError
Thrown when the authentication configuration is invalid (e.g., transparent mode on a parent with multiple child providers).SessionMissingError
Thrown when a request arrives without a valid session. This tells the client it needs to authenticate.UnsupportedClientVersionError
Thrown when a client connects with an unsupported MCP protocol version.AuthorizationRequiredError
Thrown when a tool requires app-level authorization the user has not yet granted. Supports progressive/incremental authorization. Behavior depends on session mode:- Stateful: Returns an
auth_urllink for incremental authorization - Stateless: Returns an unauthorized error (user must re-authenticate)
Example (stateful):
ToolNotAllowedError
Thrown when a tool is not in the active skill session’s allowlist. Used by the Tool Authorization Guard.ToolApprovalRequiredError
Thrown when a tool requires explicit approval before use within a skill session (approval policy mode).ToolNotConsentedError
Thrown when consent is enabled and the token’s authorized-tools claim does not include the requested tool — the runtime enforcement of the consent screen. A user who unchecked a tool during authorization cannot invoke it. Distinguished from a missing tool (-32601) so clients can prompt the user to re-authorize and select it.
data payload carries { tool }.
ToolCredentialsRequiredError
Thrown by the call-tool flow’s credential gate when a tool declares one or moreauthProviders with required: true and the credential for at least one of them is not available for the current session. This is the tool-level credential gate (distinct from AuthorizationRequiredError, which gates at the app level): a tool can be reachable yet still miss a per-provider credential. The call aborts before execute() runs.
data payload carries { tool, providers, authUrl?, auth_url? } (the connect URL is emitted under both the camelCase and snake_case keys).