
A remote Model Context Protocol (MCP) server can authenticate a request and still accept a credential that was meant for somewhere else. The distinction matters because a bearer token can be used by whoever holds it, subject to the restrictions imposed by its issuer and the receiving service. A secure integration has to connect the correct server, authorization issuer, token audience, scope and tool operation. Checking only that a token is present misses much of that work.
The July 28, 2026 MCP authorization specification describes an OAuth-based flow for HTTP transports. It does not prescribe the same flow for a local stdio server, which normally receives credentials through its environment. The checks below concern a remote HTTP-based MCP service.
Begin with the resource, not the login page
A protected MCP server identifies its authorization servers using OAuth Protected Resource Metadata. A client can discover that metadata from a 401 Unauthorized challenge carrying a resource_metadata URL, or through the server’s well-known metadata location. The metadata may identify more than one authorization server. Each has its own issuer and client-registration state.
The first step is to verify the MCP resource, fetch its metadata securely and validate the authorization server information before starting OAuth. Do not reuse a client ID, token or other registration state simply because two servers appear to belong to the same organization. The specification requires clients to keep credentials separate by authorization server.
Consider a hypothetical MCP endpoint at https://tools.example.com/mcp. The client should establish the protected resource associated with that endpoint, not accept an unrelated issuer or authorization URL just because a tool response mentions it. A returned metadata document is input to verify, not an instruction to skip issuer checks.
Bind the requested token to the MCP server
OAuth scope answers what a credential permits. It does not, by itself, reliably say where the credential may be presented. RFC 8707 addresses that distinction with the resource parameter. The MCP specification requires the client to include that parameter in both the authorization request and the token request, using the MCP server’s canonical URI.
For the example endpoint, that means requesting a token for https://tools.example.com/mcp, not a generic token for every service on example.com. Servers can distinguish resources using path components when necessary, including in multi-tenant deployments. The authorization server can then restrict the token’s intended audience. At request time, the MCP server must reject a token that was not issued for it, even when the token is otherwise valid.
The server’s token format determines how the check is performed. A JWT might carry an audience claim; an opaque token can be validated through an appropriate introspection mechanism. In either case, the implementation has to enforce the intended resource, issuer, validity and relevant permissions rather than assume that successful parsing proves authorization.
Handle the token without leaking it
For HTTP MCP requests, the client sends the access token in the Authorization: Bearer header on each request. It must not put the token into the URL query string. URLs can appear in access logs, diagnostics and browser histories, which are poor places for credentials.
A remote MCP server also must not accept or pass along a token issued for another resource. If the server calls a separate API, that API needs credentials appropriate to its own audience and permitted operations. Forwarding the client’s MCP bearer token to a downstream service is not a shortcut for authorization. It is a token-handling error.
Ask only for the scope required now
A token can be valid for the server yet insufficient for a particular operation. MCP servers should advertise needed scopes in their authorization challenges. For a client initially trying to read a record, a read-only scope may be enough; a later write action may require new authorization. Request the narrowest practical scope rather than demanding every available permission on the first connection.
This produces two distinct failure cases. An absent, expired or invalid token should result in 401 Unauthorized. A valid token with insufficient scope generally produces 403 Forbidden, which may carry an insufficient_scope challenge naming the additional permission. A client can then request the needed scope through a step-up flow, with bounded retries rather than an endless authorization loop.
Scope remains a coarse boundary. A files:write token does not by itself justify deleting a particular file; action-level rules still matter.
Verify failure cases against the actual service
A useful review exercises negative cases, not just a successful login. In a disposable environment, try a missing token, an expired token, a token from the wrong issuer, a token with the wrong resource audience and one with inadequate scope. Record the HTTP result and check the underlying service state for changes. No successful write should occur after a rejected authorization decision.
Also inspect whether the client stores tokens under the right issuer and resource, avoids placing them in URLs or diagnostic output, and retries only within the documented authorization flow. If a token is denied for one MCP endpoint, the client must not route it to a different endpoint hoping for acceptance.
Finally, separate transport authorization from tool safety. OAuth can establish that a caller is allowed to reach a protected MCP service. It cannot prove that a returned tool description is trustworthy, that a model chose a safe argument, or that an authorized operation should run without approval. Those questions need action-level policy and independent verification of what the external system actually did.
Primary references: https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization; https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/authorization-server-discovery; https://datatracker.ietf.org/doc/html/rfc8707; https://datatracker.ietf.org/doc/html/rfc9728.
About Michael Kantor
Michael Kantor is President of HOL, an open-source organization developing standards and security tooling for AI agents. His work focuses on agent identity, delegated access and security controls for tools that act on behalf of users.
HOL also develops HOL Guard, its open-source security layer for AI agents.
Join our LinkedIn group Information Security Community!












