Say you’re building an MCP tool called list_my_tickets. A person asks their AI assistant for their open tickets, the assistant calls your MCP server, and your server calls the ticketing API. The ticketing API needs to know who is asking, because it should return that person’s tickets and nobody else’s.

The quickest fix is to forward the bearer token that arrived at your MCP server, and the MCP specification forbids exactly that. The goal people usually mean by “identity passthrough” is still sound: the downstream API should act on the real user’s authority. You get there with a new credential issued for the downstream API, which your server obtains for the user it has already authenticated. The token the client sent you never leaves your server.

This guide covers the practical ways to do that and the tests we’d run before trusting any of them. It builds on our MCP OAuth authorization guide, which covers validating the tokens that arrive at your server. Here we’re concerned with what happens on the way out.

Identity passthrough and token passthrough are different things

“Identity passthrough” isn’t a term the MCP specification defines, and vendors use it for different hops. In Microsoft Foundry, for example, OAuth identity passthrough is a tool connection type: “the user completes an OAuth authorization flow, and Foundry stores and refreshes the resulting credentials,” so that “each downstream call runs as the user who authorizes the connection.” There, the downstream service is the MCP server itself. That covers the first hop, from the agent platform to your server. This guide is about the next hop, when your server has to call another API for that same user.

At that second hop, three designs are possible, and they differ in what the downstream API actually receives.

What crosses the boundaryWhat the downstream API seesProhibited by the MCP spec?
The client’s original access token, forwarded unchangedA token that was issued for your MCP serverYes
A new token for the downstream API, obtained for the same userThe user, possibly with your server recorded as the actorNo; it depends on your identity system supporting it
Your server’s own service credential, with your server checking the userYour serverNo, but the user check is entirely your job

The MCP authorization specification (2026-07-28) is direct about the first row. MCP servers “MUST validate that access tokens were issued specifically for them as the intended audience,” and “MUST NOT accept or transit any other tokens.” Clients, in turn, must send a resource parameter naming the MCP server when they request a token, using RFC 8707 resource indicators, so the authorization server can restrict the token to that server.

Put those rules together and token passthrough stops making sense. A token correctly issued for your MCP server shouldn’t be accepted by the ticketing API. If the ticketing API does accept it, either the token was issued with a broader audience than it should have been, or the API isn’t checking audience at all.

Why forwarding the token goes wrong

The MCP project’s security best practices describe token passthrough as an anti-pattern and list the risks. Paraphrasing:

  • Controls get skipped. Rate limiting, request validation, or traffic monitoring that depends on the token’s audience stops working when a client can take its token straight to the downstream API.
  • Attribution breaks. Your server can’t tell clients apart, and the downstream logs show requests that appear to come from a different identity than the server that actually forwarded them. Someone holding a stolen token can also use your server as a proxy to pull data out.
  • One compromised service exposes others. A token accepted in several places lets an attacker who obtains it at one service use it at the rest.
  • A “pure proxy” ages badly. Once you need a control in the middle, a design built around forwarding has nowhere to put it.

The mitigation in that document is one line: “MCP servers MUST NOT accept any tokens that were not explicitly issued for the MCP server.” The patterns below give the downstream API a user identity within that rule.

Four ways to carry the user downstream

Which pattern you can use depends mostly on your identity provider and on who issues tokens for the downstream API. In order of how much of the work the identity system does for you:

1. Token exchange at a security token service

RFC 8693, OAuth 2.0 Token Exchange, lets a client “request and obtain security tokens from authorization servers acting in the role of an STS” (a security token service). Your MCP server sends the token it accepted as the subject_token, which the RFC defines as the token representing “the party on behalf of whom the request is being made.” It names the downstream service with the audience or resource parameter. The STS applies its own policy and, if it agrees, returns a token for the ticketing API.

The RFC distinguishes two kinds of result. With impersonation, the acting party “is given all the rights” of the user and is indistinguishable from them. With delegation, the actor “still has its own identity separate from” the user, and a JWT can record that through the act claim, which “provides a means within a JWT to express that delegation has occurred.” Prefer delegation where your STS supports it. A downstream log that says “the MCP server, acting for this user” is much more useful during an investigation than one that just says “this user.”

Two cautions. Whether the STS issues a delegated token at all is “at the discretion of the authorization server and applicable policy and configuration,” so you’re relying on that policy being written carefully. And the RFC’s own security section notes that “any time one principal is delegated the rights of another principal, the potential for abuse is a concern.” Ask for the narrowest scope the tool needs on each exchange.

2. The Microsoft Entra on-behalf-of flow

If your users sign in with Microsoft Entra ID, the on-behalf-of (OBO) flow is the built-in version of this pattern: “a web API using an identity other than its own to call another web API.” Your MCP server, authenticating with its own client credentials, sends the incoming token as the assertion with grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer and requested_token_use=on_behalf_of.

The documented constraints line up well with MCP’s audience rule. The incoming assertion “must have an audience (aud) claim of the app making this OBO request,” so your server can only redeem tokens issued to it. The flow “only works for user principals,” and it uses delegated scopes, not application roles. Single-page apps are told to hand their token to a middle-tier confidential client rather than run OBO themselves. Read the consent section of that page before you rely on it. It explains how the downstream scopes get approved, for example through knownClientApplications or administrator consent, and that needs to be settled before anyone calls the tool.

3. A per-user grant held by your MCP server

Many downstream services, such as a SaaS ticketing product, don’t share an identity provider with your MCP clients, so there’s nothing to exchange. In that case your MCP server becomes an OAuth client of the third-party service in its own right. It sends the user through that service’s consent screen once, stores the resulting refresh token, and uses it for that user’s later calls.

This is the arrangement the MCP security guidance analyzes under the confused-deputy problem. Your server usually has one static client ID with the third party, and the third party’s authorization server may remember the user’s consent for that client ID with a cookie. If your server also lets MCP clients register themselves dynamically, an attacker can register a new client, send the user a crafted link, and receive an authorization code without the user ever approving that client. (The guidance notes that dynamic client registration is deprecated as of the 2026-07-28 protocol version, but the attack still applies to proxies that support it.) The required fix is that “MCP proxy servers MUST implement per-client consent,” backed by specific protections: a registry of which MCP clients each user has approved, a consent screen that names the client and the third-party scopes, exact redirect URI matching, and a single-use, short-lived state value. Treat that section as a build checklist.

Store the third-party tokens encrypted and keyed to the user identity from the inbound token your server checked, never to anything the client or the model supplies. And decide what happens when the user is removed from your identity provider: their stored third-party grant doesn’t disappear on its own.

4. A service identity, with your server doing the authorization

Sometimes the downstream API only supports a service account. That’s a legitimate design, though it isn’t identity passthrough: the downstream API sees your server, so the per-user decision (“may this person read ticket 4812?”) has to happen in your MCP server, against the user identity from the token your server accepted. Our OAuth guide covers the record-level checks and audit attribution this needs.

Comparing the patterns

PatternWho the downstream API seesWhere the per-user policy livesWhat you must storeTypical failure to test
Token exchange (RFC 8693)The user, ideally with your server as actorThe STS and the downstream APINothing long-lived, or short-lived cached tokensExchange succeeds for a scope or audience the tool shouldn’t have
Entra on-behalf-ofThe user, via delegated scopesEntra consent plus the downstream APIShort-lived cached tokensConsent missing, or tokens cached across users
Per-user third-party grantThe user, as the third party knows themThe third-party service, after per-client consentEncrypted refresh tokens per userConsent skipped for a new client; grant outlives the user
Service identityYour MCP serverYour MCP serverOne service credentialUser check missing on one tool or one code path

Where enterprise-managed authorization fits

You may also run into the MCP Enterprise-Managed Authorization extension, listed as stable in the ext-auth repository. It answers an earlier question: how the MCP client gets a token for your server when an organization’s identity provider sets the policy. The client exchanges its single sign-on assertion at the identity provider for an identity assertion grant, then presents that to your server’s authorization server. It builds on the IETF Identity Assertion JWT Authorization Grant draft, which is still an Internet-Draft (version 06, dated October 31, 2026).

That’s useful for central control over which AI clients may reach which MCP servers. It doesn’t remove the downstream question. Your server still receives a token issued for itself and still needs one of the four patterns above to reach the ticketing API.

Reaching a downstream API as the userExample: an MCP tool reads the signed-in user's tickets. The client's token stops at the MCP server; a new token is issued for the downstream API.
  1. MCP clientPresents a token issued for the MCP server.
  2. MCP serverValidates the token and takes the user identity from it, never from tool arguments.
  3. Token service or third-party grantIssues a separate, narrowly scoped token for the downstream API, for that same user.
  4. Downstream APIAccepts only tokens issued for itself and applies the user's own permissions.

Take the user’s identity from the accepted token only

Whichever pattern you choose, take the user identity your server acts for from the token it checked and accepted. Never take it from a tool argument, a header the client sets, or text the model produced.

This matters more in MCP than in a typical web API, because tool arguments are often written by a model that may have read hostile content. A user_id field in a tool call proves nothing about who is asking. If your exchange, your token cache, or your database query uses that field, a prompt injection can turn into a request made with someone else’s authority.

Apply the same rule to caching. If you cache downstream tokens to avoid exchanging on every call, key the cache on the issuer and subject from the accepted token, plus the downstream audience and scopes. A cache keyed only on the tool name or the downstream service will eventually hand one user’s token to another user’s request.

Tests to run before you trust it

Run these with test identities and disposable records in a non-production tenant. We haven’t run them against any particular product; they’re a review plan.

TestExpected result
Send the client’s MCP token directly to the downstream APIDownstream rejects it (wrong audience)
Call the tool as user A, asking for a record only user B can seeDownstream denies it under user A’s identity
Put user B’s identifier in a tool argument while signed in as user AServer ignores the argument for identity; downstream sees user A
Two users call the same tool at the same timeEach downstream request carries its own user; no cache crossover
Inspect the exchanged token through the issuer’s supported mechanismAudience is the downstream API; scopes are the narrow set; actor recorded where supported
Disable user A in the identity providerNew exchanges fail; record how long cached or stored tokens keep working
A new MCP client connects for a user with an existing third-party grant (pattern 3)Consent is requested for that client; nothing is silently reused
Exchange or refresh failsThe tool fails closed; no fallback to a service credential

The last row catches a common shortcut: “if the exchange fails, use the service account.” That quietly converts a per-user design into pattern 4 without the authorization checks pattern 4 requires.

Finally, read the logs for one allowed and one denied call. You should be able to connect the MCP client, the user, the downstream audience and scopes, and the result, with no bearer tokens or refresh tokens in the record.

A note on local stdio servers

Everything above applies to MCP servers reached over HTTP. The specification says implementations using the stdio transport “SHOULD NOT follow this specification, and instead retrieve credentials from the environment.” A local server therefore usually acts with whatever credential sits in its environment, which is typically the developer’s own. There’s no per-user exchange to design. The review question becomes how much that credential can do, and our sandbox security guide covers keeping it narrow.

For remote servers, we’d get a fresh, narrowly scoped token for each downstream service, tied to the user you authenticated, and use the tests above to confirm that a forwarded or borrowed token gets rejected.

Security services from Libre Labs View all posts