Some tools should not run on the strength of a login from this morning. Deleting a workspace, exporting a customer table, or changing who has admin rights are examples. A security reviewer will ask how the server gets stronger proof from the user at that moment, and what happens to the call that triggered the request. This tutorial covers the mechanism: challenge the call, let the client re-authorize, then check the result on the retry.
Two different challenges
Step-up covers two separate needs. Keep them apart in the design.
- More permission. The token lacks a scope the tool needs. This is RFC 6750 territory: the resource server answers with
insufficient_scope. - More assurance. The token has the right scope, but the user authenticated too long ago or with a weak method. This is RFC 9470 territory: the resource server answers with
insufficient_user_authentication.
A tool can need both. Check them in that order, and return one challenge at a time.
The scope challenge
The MCP authorization specification describes the pattern for a call that needs more scope than the token carries. The server returns HTTP 403 with a WWW-Authenticate header:
HTTP/1.1 403 Forbidden
WWW-Authenticate: Bearer error="insufficient_scope",
scope="records:read records:export",
resource_metadata="https://mcp.example.com/.well-known/oauth-protected-resource"
Three details matter.
- Return 403, not 401. A 401 means the token is invalid or missing, and a client may respond by discarding its session. A 403 means the token is valid and not enough.
- Put the full scope set the retry needs in
scope, not only the missing one. Otherwise a client that requests exactly what you list gets a token that lost the earlier scopes. - Keep
resource_metadatain the header so the client can rediscover the authorization server without guessing.
Enforcement stays on the server. The challenge is a courtesy to the client. A client that ignores it gets the same 403 on every attempt.
The assurance challenge
RFC 9470 defines how a resource server asks for a stronger or fresher authentication event. The challenge carries two possible parameters:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer error="insufficient_user_authentication",
error_description="A fresh multi-factor authentication is required",
acr_values="phr phrh", max_age=300
acr_values names the authentication context the tool requires. max_age states how many seconds old the authentication may be. The client sends both through to the authorization server on its next authorization request, and the server re-authenticates the user.
Note that RFC 9470 uses a 401 for this error. The MCP specification's scope guidance uses 403 for insufficient_scope. Follow each document for its own error and do not merge them.
Two points about the values:
- The
acrvalues are defined by your identity provider or the enterprise's policy. Do not invent names. Read what the IdP actually issues in theacrclaim and map your tool tiers to those strings. max_agecompares against theauth_timeclaim. If the IdP does not issueauth_timein the access token, you cannot enforce it and you should say so in the evidence pack rather than pretend.
Verify on the retry, not on the challenge
The step that fails reviews is the check after the user comes back. On the retried call, the server must:
- Validate the token as it does for any call: signature, issuer, expiry, and audience bound to this server.
- Confirm the scope set includes what the tool requires.
- Read
acrandauth_timefrom the validated token, not from a header or a tool argument. - Compare
acrto the required level andnow - auth_timeto the tool's maximum age. - Only then run the handler.
If the check passes on a token the user obtained for an earlier call, it passes. That is correct behavior only when the age limit holds, so keep the limit short for the top tier. Five minutes is a common starting point. Your customer's policy decides.
Which tools get a step-up requirement
Do not apply this to every tool. A challenge on each call trains users to click through and breaks unattended flows. Put the requirement in the same tier table you use for tool annotations:
| Tier | Example | Scope | Assurance |
|---|---|---|---|
| Read | List records | records:read | Session login |
| Write, reversible | Update a field | records:write | Session login |
| Destructive or exfiltrating | Delete, bulk export | records:export | Fresh, strong acr |
| Access-changing | Grant a role | admin:roles | Fresh, strong acr |
Annotations such as destructiveHint tell a client what the tool claims. They do not enforce anything. The step-up check is the enforcement, and it lives in the server.
Where the client cannot help
Not every caller can answer a challenge.
- Unattended agents have no user to re-authenticate. For those, the tools in the top tiers should be absent from the tool list, or refuse with a clear error. Do not fall back to a service credential.
- Clients that do not implement the retry will show the user an error. Write the error text for a person: say what was refused and why, without echoing token contents.
- Token exchange downstream. If your server exchanges the user's token for a downstream one, carry the assurance information into the exchange if the downstream system also enforces it. Otherwise the downstream call quietly drops to a weaker context.
Audit the challenge and the outcome
Emit an audit event for each challenge issued and for each retry that succeeds or fails. Record the tool, the user, the tenant, the required and observed acr, the token age, and the result. A reviewer who asks "show me a destructive action and the authentication behind it" should get one query, not a code reading.
Test it
Add these to the authorization regression suite:
- A token with the scope and a stale
auth_timeis refused on a top-tier tool. - A token with the scope and a weak
acris refused. - A token with fresh, strong authentication and the scope succeeds.
- A forged
acrin a request header or a tool argument has no effect. - The 403 header contains the full scope set required, not a fragment.
What to put in the evidence pack
- The tier table with scope and assurance requirements per tool.
- The
acrvalues your IdP issues and how each maps to a tier. - A sample challenge and a sample successful retry with the audit events from both.
- A statement of any limit, such as an IdP that does not issue
auth_time.
When you do not need this
If your server is read-only, or every tool acts only on data the user could already freely change and undo, step-up adds friction without reducing risk. Enforce per-call scopes, test them, and skip the assurance layer. It earns its place when a single call can delete, export, or change who has access.
If you want a second reader on how your server handles high-risk calls before a customer review, that is a scoped piece of audit work, and we tell you in week one what we find.