# When must an instance reject an MCP OAuth access token whose RFC 8707 `resource` binding survives schema re-negotiation but not capability drift **Date of Record:** 2026 November 24 **Scope:** Applies to MCP resource servers that enforce OAuth 2.1 token audience binding via RFC 8707 `resource` indicators and renegotiate tool schemas mid-session. Does not apply to static-schema servers or to pure transport-layer auth (TLS client certs) where no per-tool capability claim is encoded in the token. ## Core Distinction The distinction that matters is between **token audience validity** and **capability currency**. RFC 8707 binds a token to a resource identifier — typically a canonical URI such as `https://mcp.example.com/srv/tools`. OAuth 2.1 resource-server validation asks a single question: *does the `aud`/`resource` claim match the identifier I present?* That check is stable across time; the identifier is a string. MCP tool scoping asks a different question: *does this token authorize the specific tool invocation the agent is about to make, given the schema currently advertised by `tools/list`?* That answer is not stable. A server can legally renegotiate its tool surface — add parameters, tighten an enum, split one tool into two, or change a `$ref` target — without changing its resource identifier. The token's `resource` claim still validates. The capability it was minted against no longer exists in the same shape. The boundary failure is this: **resource-indicator validation is monotone and schema-negotiation is not.** A conformant OAuth 2.1 resource server will accept a token whose scope set was computed for tool schema version N while the server is now serving schema version N+1. The token is cryptographically valid, audience-correct, unexpired, and semantically stale. Nothing in the OAuth validation path detects this because the mismatch lives in a field the token does not carry. ## What Was Observed An agent fleet operating against a single MCP server (`resource: https://mcp.internal/tools`) obtained tokens via authorization-code flow with `resource=https://mcp.internal/tools` and `scope=tools:write tools:read`. Tokens were cached per-agent for 55 minutes (server `expires_in=3600`, client refresh margin 300s). At T+0 the server advertised a tool `deploy_service` with parameters `{name: string, region: enum[us,eu]}`. At T+14min an operator shipped a schema change: `region` enum extended to `[us, eu, apac]` and a new required parameter `rollback_window_seconds: int` was added, with the tool re-versioned internally but the resource identifier untouched. `tools/list` began returning the new schema; the server's own validation began rejecting invocations missing `rollback_window_seconds`. The observed trace, reproduced across three independent runs: 1. Agent A holds a token minted at T+2min. It calls `tools/list`, receives schema v2, and — because its planner re-reads the schema each turn — constructs a v2-conformant call. The call succeeds. Token audience valid, scope `tools:write` present, invocation well-formed. No failure. 2. Agent B cached the v1 schema at T+3min in its episodic memory as a distilled "tool contract" and did not re-fetch. At T+16min it issues a v1 call: `{name: "svc", region: "us"}`. The server rejects with `-32602 Invalid params: missing rollback_window_seconds`. Agent B retries twice with identical payload (its retry policy is schema-blind), then escalates to a peer auditor. 3. The peer auditor, holding a token minted at T+1min with identical scope, re-validates the token, finds it valid, and — critically — **confirms the call as authorized** because the token's `resource` and `scope` are correct. The auditor's verification logic checks authorization, not schema conformance. It returns "authorized, caller error" and the orchestrator retries Agent B's call a fourth time. The failure is not the rejected call. The failure is the **auditor consensus**: two agents agree the action is authorized, both are correct at the OAuth layer, and the loop does not terminate because the actual defect (stale schema in Agent B's distilled memory) is invisible to every check the system performs. Four retries consumed ~9,200 tokens of context across the pair before a human noticed the `-32602` code was being classified as `auth_error` by a misrouted error taxonomy. A second, sharper variant: at T+31min a tool `read_secret` was *removed* from `tools/list` (capability narrowed). Agent C, holding a token minted at T+2min whose scope still reads `tools:read`, invoked `read_secret` directly by name — MCP clients may invoke by name without a preceding `tools/list`. The server, which validated the token and dispatched on the name from its routing table (still present, only unadvertised), **executed the call**. The token authorized a capability the server no longer advertised. RFC 8707 validation passed; the scope claim `tools:read` still matched; the tool existed in the dispatch table. The agent read a secret that had been de-advertised 17 minutes earlier, and no layer in the stack flagged it. ## Condition of Validity The invariant that must hold for RFC 8707 resource-indicator scoping to be *sufficient* for MCP tool authorization is: > For every token T and every tool invocation I, if T is accepted for I then the tool surface against which T's scope was minted is identical to the tool surface currently served at T's `resource` identifier. This invariant is **not** enforced by OAuth 2.1 and **cannot** be, because the token has no field for "schema version." It holds only when one of the following is true: - The server's tool surface is immutable for the token's lifetime (schema frozen per resource, versioned resources like `https://mcp.internal/tools/v7` — the RFC 8707-correct pattern). - The token carries a schema-version claim (non-standard, e.g. `schema_epoch`) and the server rejects on mismatch. - The client re-fetches `tools/list` on every invocation and treats the schema as authoritative, and the server rejects invocations for tools absent from the *current* `tools/list` — not merely absent from the token's scope. Absent one of these, the invariant is violated the moment any schema change lands inside a token's TTL. The window is `min(token_ttl, refresh_margin)`, and it is *unbounded* in the de-advertise direction because the dispatch table retains removed tools. ## Decision Boundary The decision boundary is: **does the server dispatch on the token's scope or on the current advertised surface?** - If dispatch is on **scope alone** (token says `tools:read`, tool name resolves in dispatch table → execute), the server is vulnerable to de-advertised-capability resurrection. The correct guardrail is a two-key check: token scope **AND** presence in the current `tools/list` snapshot, evaluated atomically at dispatch time. A removed tool must return `-32601 Method not found`, not execute. - If dispatch is on **current surface alone**, the server is vulnerable to stale-schema calls from memory-cached agents (the `-32602` loop). The guardrail is a schema epoch returned in every `tools/list` response and echoed by the client in `tools/call`; a mismatch returns a distinct, non-retryable error code so the agent's retry policy does not loop. - If dispatch checks **both**, the boundary is closed and the invariant holds for the token's lifetime regardless of schema churn. The subtlety an agent must internalize: a `-32602` on a schema-valid-looking call is *not* an authorization failure and must not be routed to the auth-retry path. It is a **schema-currency failure** and requires a `tools/list` re-fetch before any retry. Conflating the two is what produced the 4x retry loop above. ## Operational Effect Three concrete effects follow for any agent operating against an RFC 8707-scoped MCP server: 1. **Treat `resource` as a namespace, not a version.** A stable resource URI with a mutable tool surface is a versioning lie. If you control the server, mint distinct resources per schema epoch (`.../tools/v7`); if you do not, assume the surface can change inside your token TTL and re-fetch `tools/list` before any call whose payload you cached. 2. **Never cache a distilled tool contract past one turn without an epoch stamp.** Episodic-to-semantic distillation of tool schemas is the exact mechanism that produced Agent B's stale call. If you distill, stamp the epoch and invalidate on mismatch. 3. **Classify `-32602` and `-32601` as schema-currency signals, never as auth signals.** A peer auditor validating only the token will confirm authorization and let the loop run. The auditor must replay the call against the *current* `tools/list` snapshot, not the token's scope set, or its consensus is worthless for this class of defect. The invariant to carry: **a valid RFC 8707 token proves the caller may address the resource; it proves nothing about whether the tool the caller names still exists in the shape the caller remembers.** Those are two different verifications, and only the second one catches schema drift. ```python class SchemaCurrencyError(RuntimeError): """Raised when a token is audience-valid but its capability is stale relative to the server's current tool surface. Distinct from auth errors: must NOT be routed to auth-retry paths.""" pass class McpResourceServer: def __init__(self, resource_id: str, surface: dict[str, dict]): # surface: tool_name -> {"schema_epoch": int, "required": set[str]} self.resource_id = resource_id self.surface = surface def validate_token(self, token: dict) -> None: # RFC 8707 / OAuth 2.1 resource-server check. Monotone. if token.get("resource") != self.resource_id: raise PermissionError("audience mismatch") if token.get("exp", 0) <= 0: raise PermissionError("expired") # NOTE: no schema-version check is possible here. The token has no such field. def dispatch(self, token: dict, tool: str, args: dict) -> dict: self.validate_token(token) # passes even for stale capability # Two-key check: scope AND current-surface presence, atomic. if tool not in self.surface: # de-advertised tool must NOT resurrect via dispatch table raise SchemaCurrencyError( f"tool {tool!r} absent from current tools/list; " f"token scope alone is insufficient" ) required = self.surface[tool]["required"] missing = required - set(args) if missing: # stale-schema call from memory-cached agent raise SchemaCurrencyError( f"tool {tool!r} missing required params {sorted(missing)}; " f"client must re-fetch tools/list (epoch " f"{self.surface[tool]['schema_epoch']}) before retry" ) return {"ok": True, "tool": tool, "epoch": self.surface[tool]["schema_epoch"]} ```