A successful sign-in is a small part of an MCP security review. We also want to know which server the token was issued for, which operations it permits, and whose authority reaches the service behind the tool.
For a remote MCP server using OAuth, validate tokens for that server, enforce the required permissions for each operation, and use appropriate credentials for downstream APIs. Passing an incoming bearer token through the entire chain can erase the boundaries you meant to create.
The MCP authorization specification dated July 28, 2026 defines an authorization flow for HTTP-based transports. Local stdio servers have a different credential arrangement; an OAuth diagram for a remote server should not be assumed to describe them.
Separate the identities in the request
Consider a hypothetical MCP server that reads deployment records from an internal service. There are several participants: a person or workload asking for access, an AI application acting as a client, the MCP server receiving the request, and the deployment API holding the records.
Write down which participant each credential represents. Does the deployment API receive a delegated user identity or a service identity shared by the MCP server? Either design needs an explicit access policy. A shared service account cannot, by itself, prove that a particular user may read a particular deployment.
Draw two credential relationships: client to MCP server, and MCP server to deployment API. For each, record the issuer, intended recipient, permissions, expiration behavior, and revocation mechanism. Keep credential values out of the design document.
- ClientPresents a token issued for the MCP server.
- MCP serverValidates the token and checks the requested operation and record.
- Deployment APIReceives separate, supported downstream credentials and enforces its access rules.
Check audience before accepting the token
The MCP specification requires the server to validate that an access token was issued for it as the intended audience. A valid signature from a familiar issuer is not enough to establish that a token belongs at this server. The OAuth security best current practice, RFC 9700, also describes restricting tokens to their intended resource servers.
In our deployment example, a token issued for a reporting application should not become valid at the MCP endpoint simply because both use the same identity provider. Try that as a negative integration test with test credentials in an isolated environment.
Don’t assume every token is a JWT you can decode locally. Use the issuer’s supported validation mechanism for the token format, and verify the recipient and permissions through that mechanism. Decoding fields without establishing trust in them is not validation.
Why token passthrough causes trouble
The MCP security guidance explicitly prohibits token passthrough: accepting a client’s token without validating that it was issued for the MCP server, then forwarding it unchanged to a downstream API. The guidance also describes confused-deputy risks and per-client consent requirements for relevant proxy arrangements.
For the deployment integration, configure a separate credential relationship supported by the upstream service. The exact mechanism depends on that service: delegated authorization and application credentials have different consequences. A token-exchange feature is useful only if the identity system supports the intended delegation and preserves the required restrictions.
Then inspect what the downstream API actually sees. If every call appears as one powerful service account, the MCP layer needs reliable user-to-record checks, and the audit trail needs enough attribution to investigate a request. A user identifier supplied in tool arguments should not be accepted as proof of identity.
Scopes need an operation behind them
A scope named deployments:read should have a clear meaning in code. Which records can it read? Does it permit downloading associated logs? Can those logs contain secrets or data from a different tenant?
For a tool that changes configuration, we would test both the tool-level permission and access to the particular target. A valid token with a broad read scope should not acquire write authority because the model describes the change as necessary.
Keep permission discovery and enforcement consistent. A client may omit a tool from its interface, but a direct invocation still needs to be checked by the server. Test that path explicitly.
A practical authorization test set
Use these cases to review your own integration with a test issuer and disposable records. They aren’t results from a product audit.
| Test credential or request | Expected evidence |
|---|---|
| Valid token issued for a different resource | Request rejected before the tool reaches the deployment API |
| Correct audience, missing operation scope | Operation denied, with a safe reason recorded |
| Permitted scope, record in another tenant | Record access denied without leaking its content |
| Expired token | Request rejected through the normal authentication path |
| Permission removed during an active session | Subsequent access follows the documented revocation or refresh behavior |
| Direct call to a tool hidden by the client | Server still enforces the same permission checks |
| Upstream credential cannot be obtained | Failure remains bounded; no fallback to a more powerful identity |
Measure how long revocation takes. Some designs validate an access token locally until it expires; others consult a service capable of rejecting it sooner. Record the behavior you implement, including caches, instead of promising that removing a user takes effect instantly.
Make a rejected request observable
For each negative test, send one allowed control request through the same test client, then the request expected to fail. Capture the MCP server’s decision and verify that the downstream API received no operation for the rejected call. An error displayed by the client alone does not show where rejection occurred.
Include a trusted-issuer token for the wrong recipient, a valid token with insufficient scope, and a valid token requesting another tenant’s test record. These isolate different controls. Keep the full tokens out of test reports; use issuer, audience, scope, expiry, and a protected credential reference as appropriate.
Repeat the check through every supported HTTP entry point. If the server’s policy or credential cache changes, rerun the relevant cases and measure any revocation delay again.
Review the failed requests too
For the last check, follow a denied call through the logs. We should be able to connect the initiating identity, target, policy decision, and upstream outcome without finding bearer tokens in the record.
Our code execution and MCP guide also examines the runtime’s limits. Before expanding access, we want to see an unauthorized operation rejected by the server and an out-of-bounds execution blocked by the runtime, with records explaining each decision.
