MCP token security

MCP token passthrough and the confused deputy

Most MCP servers sit in front of an API, so every one of them has to decide what happens to the token a client sends. The specification has firm rules on that decision, and they exist because of two specific attacks.

Written by Octri · Checked 3 November 2026

Token passthrough

Token passthrough means accepting a token from a client without confirming it was issued to the MCP server, then sending it on to the API behind it. The specification forbids it. A server must reject tokens that do not name it as the audience, and when it calls an upstream API it must use a separate token issued for that API.

The rule protects three things. Controls that depend on the token’s audience, such as rate limits and request validation, stay in force. Logs can tell which client acted. And a token stolen from one service stops working on the next one.

Audience validation

Clients send the resource parameter so the authorization server can bind a token to one MCP server, when it supports that. The server’s half of the job is to read the audience claim, or an equivalent, and refuse anything issued for another resource. Scopes alone are insufficient for this, because a token for a different service can carry familiar scope names.

The confused deputy attack

This one targets an MCP proxy server that uses one static client ID with a third-party authorization server and lets MCP clients register themselves. The third party remembers consent for that static client ID in a browser cookie.

An attacker registers a client with their own redirect URI and sends the victim a crafted link. The cookie makes the third party skip its consent screen, and the MCP authorization code travels to the attacker’s redirect URI.

How Octri handles this

Octri’s three sign-in options handle tokens differently, and the choice matters for this rule.

A key page and Octri signing people in to your OAuth keep the two credentials apart: the client holds a token for the MCP server, and the upstream key or token stays encrypted on Octri. In the OAuth option the person approves each client on a consent page first.

Your own authorization server works differently. Octri checks each token’s signature, issuer, expiry and audience, or introspects it, then forwards that same token to your API. This departs from the specification, which has no exception for it. We chose it for the case where the authorization server and the API belong to one owner and the API remains the final check.

If your security review requires a strict reading of the rule, Octri signing people in to your OAuth is the option that meets it.

Questions

It can. The requirement is that the upstream call uses a separate token issued for the upstream API, and an exchange produces one if your authorization server issues it for that audience. The MCP specification leaves the method to you.

Try it on your own spec

Generate an MCP server from your OpenAPI spec on the Free plan, with every tool set to run, ask first or stay off.