1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * This file is part of the Nexus MCP SDK package.
7: *
8: * (c) 2026 John Paul E. Balandan, CPA <paulbalandan@gmail.com>
9: *
10: * For the full copyright and license information, please view
11: * the LICENSE file that was distributed with this source code.
12: */
13:
14: namespace Nexus\Mcp\Client\Auth;
15:
16: /**
17: * What a client does when an MCP server answers that the scopes its token carries are insufficient.
18: *
19: * @see https://datatracker.ietf.org/doc/html/rfc6750#section-3.1
20: */
21: enum InsufficientScopePolicy
22: {
23: /**
24: * Ask the resource owner to grant the challenged scopes as well and retry, raising
25: * `InsufficientScopeException` only once asking cannot help.
26: */
27: case Reauthorize;
28:
29: /**
30: * Raise `InsufficientScopeException` immediately, without discovery or a consent screen, leaving
31: * the decision to the caller.
32: */
33: case Fail;
34: }
35: