The Right Way for MCP Servers to Call APIs on Behalf of Users: Token Exchange

MCP servers should replace token pass-through with token exchange, obtaining an API-bound, least-privilege token and verifying claims on the API side.
The article discusses credential handling when an MCP server calls a backend API on behalf of a user. Passing the user's MCP token straight through forces the API to accept a credential not issued for it, causing scope mismatch, wrong audience, and uncontrolled lifetimes. WorkOS Connect recommends token exchange: swap the user token for a new token targeting the API, trimmed to least privilege with an explicit audience binding, then have the API actively verify audience, scope, issuer, and validity instead of trusting any presented token. This positions the MCP server as a controlled intermediary and eliminates pass-through lateral-movement risk.
When your MCP server needs to call a backend API on behalf of a user, the most dangerous approach is to pass the user's original token straight through. The solution from WorkOS Connect is token exchange: swap the user's MCP token for a new token scoped specifically to your API, then verify that the claims your API requires are trustworthy.

Why you shouldn't pass the MCP token straight through
An MCP server sits in an awkward trust position: it holds the user's credentials, yet it also needs to act on the user's behalf to access another system. If you stuff the MCP token as-is into requests to the backend API, the API is forced to passively accept a credential that wasn't issued for it. Scope mismatches, incorrect audience, and uncontrollable lifetimes all surface at once.
The idea behind token exchange is to separate "who the user is" from "what this service is allowed to do." The MCP server uses the user token to obtain a new token from the authorization server—one whose audience is your API and whose scope is narrowed as needed. The original MCP token never leaves the channel between the MCP server and the authorization server.
The difference between audience and scope: In the OAuth world, these two fields constrain different dimensions. Scope describes what a token "can do"—the set of permissions. Audience describes "who the token is for"—typically the identifier of the target API. Both are essential: even if the scope matches perfectly, a token whose audience points to another service should not be accepted by your API. Passing the token straight through is dangerous precisely because the original token's audience is often the MCP server itself or another system; the backend API trusts it by default, effectively bypassing the audience check.
Steps to implement token exchange
According to WorkOS Connect, the flow breaks down into two actions: exchange and verification.
Step 1: Exchange for a token scoped to your API
The MCP server initiates an exchange request holding the user's MCP token. After the authorization server validates that token, it issues a new token targeting your API. The key point is scope trimming—the new token should contain only the permissions necessary to call the target API, not inherit the full capabilities of the user token. This aligns with the principle of least privilege and simplifies authorization decisions on the API side.
The audience field must explicitly point to your API. That way, even if the token leaks in another context, it can't be used to access unrelated services.
The RFC 8693 token exchange spec: This mechanism is standardized by the IETF in "OAuth 2.0 Token Exchange." At its core, it uses one token (subject_token) to obtain another from the authorization server, and the request can declare the desired audience, scope, and token type. After validating the original token, the authorization server issues a new token per the request and may choose to preserve some claims or regenerate them. In the MCP scenario, the subject_token is the user's MCP token, while the newly issued token's audience points to the backend API and its lifetime is typically shorter than the original, further shrinking the exposure window.
Step 2: Verify the claims your API requires
Obtaining a token isn't the end of it. When your API receives a request, it must check that the token's claims satisfy its own requirements: is the audience the current API, does the scope cover this operation, is the issuer trusted, is the token still valid? This is exactly what WorkOS Connect emphasizes—the API must actively verify the claims it needs to trust, rather than trusting any token handed to it by default.
JWT and claims verification: Most tokens issued by modern authorization servers are JWTs (JSON Web Tokens), composed of a header, payload, and signature, with claims stored in the payload. Verification on the API side typically involves three steps: first, verify the signature using the authorization server's public key (retrieved via the JWKS endpoint) to confirm the token hasn't been tampered with and comes from a trusted issuer; then check standard claims such as aud, scope, and exp; finally, check custom claims against business requirements. Verifying only the signature without checking audience and scope is the most common vulnerability in practice—attackers can exploit it to replay a legitimate token issued for another service against your API.
What this pattern changes
From an architectural standpoint, token exchange draws clear trust boundaries. The MCP server is no longer a "credential courier" but a controlled intermediary: it can act on the user's behalf, but every action carries the explicit endorsement of the authorization server. The API side doesn't need a bespoke authentication scheme for this new MCP form factor either—it can keep doing standard token verification.
For developers, this means adding an exchange step to the MCP server implementation and an extra layer of claims-verification code. The cost is clear, and the benefit is eliminating the lateral-movement risk that comes with passing tokens straight through.
Practical considerations
Be restrained in scope design. The fewer permissions requested during exchange, the smaller the blast radius if the token leaks. Audience binding is non-negotiable—it's the core safeguard against tokens being reused across services. Claims verification should be handled centrally at the API's entry point rather than scattered across business logic, otherwise checks are easy to miss.
This approach is essentially the OAuth token exchange idea applied to the MCP scenario. If you already use a standard authorization server, integration will be relatively smooth; if your existing auth system is homegrown, first assess whether it has an authorization endpoint that supports exchange.
One-line Summary
MCP servers should replace token pass-through with token exchange, obtaining a new token bound to the target API's audience and trimmed to least privilege, with the API actively verifying claims.
Paragraph Summary
The article discusses credential handling when an MCP server calls a backend API on behalf of a user. Passing the user's MCP token straight through forces the API to passively accept a credential not issued for it, bringing risks like scope mismatch, wrong audience, and uncontrolled lifetimes. WorkOS Connect recommends token exchange: the MCP server uses the user token to obtain a new token targeting the API, trimming scope to least privilege and binding the audience explicitly. After obtaining the token, the API must actively verify claims such as audience, scope, issuer, and validity, rather than trusting whatever token is presented. This pattern positions the MCP server as a controlled intermediary, clarifies trust boundaries, and eliminates the lateral-movement risk caused by token pass-through.
Related articles

Prompt Engineering for Beginners: From Writing Prompts to Engineering Thinking
Starting from the essence and four functions of prompts, this article systematically explains the six-step process, four success criteria, learning value, and practical limitations of prompt engineering to help you build a complete understanding.

Anthropic Launches Nasdaq IPO: AI Giant's Listing and Risk Disclosures
Anthropic officially launches its Nasdaq IPO under ticker ANT, with market valuation expected to potentially exceed SpaceX's record. The prospectus devotes nearly 100 pages to AI risks, while first-half revenue grew over 14x but net losses widened sharply, reigniting the AI bubble debate.

Rust cURL Clone Uses 4,832 unsafe Blocks—Is the Memory Safety Myth Broken?
A Rust cURL clone uses 4,832 unsafe keywords, challenging Rust's memory safety narrative. We analyze what unsafe really means, compare Fil-C, and examine rewrite motives.