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.
Per-client consent
The specification requires proxy servers to get consent for each client before forwarding to the third party. That consent page belongs to the MCP server and has these requirements:
- Name the requesting client and show the third-party scopes and the registered redirect URI
- Store approved client IDs per user, and check them before starting the third-party flow
- Match redirect URIs by exact string
- Protect the page from CSRF and block framing
- Use a random, single-use, short-lived
statevalue, set only after the person approves
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.
References
Checked against MCP specification revision 2026-07-28 on 3 November 2026.
Further reading
- Your MCP server authenticates users. Does it preserve their permissions?From the Octri blog.
- MCP security best practicesThe full checklist: sign-in, token checks, least privilege, approvals, limits and audit logs.
- MCP OAuth and authorizationThe sign-in flow in request order, from the first 401 to a scoped access token.
- Tool poisoning and prompt injectionHow instructions reach a model through tool metadata and results, and the controls that contain them.
- MCP audit logs and rate limitsThe fields worth recording for each tool call, and how to size per-tool limits and write caps.
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.