Auth for MCP
How MCP authorization works over HTTP, which OAuth pieces the spec relies on, and the token mistakes to avoid.
Remote MCP servers that need to know who is calling use the authorization flow in the MCP specification, which builds on OAuth 2.1. Local servers over stdio usually read credentials from the environment instead. These guides cover the HTTP flow step by step and the token handling the spec forbids.
Read in this order
- MCP authorization step by step: OAuth 2.1, discovery and PKCE
Every request an MCP client makes to get a token for a protected remote MCP server, in order, per the 2026-07-28 specification.
- Token passthrough in MCP: why servers must not forward client tokens
An MCP server that relays the token it received to another API defeats audience checks, rate limits and audit trails. The spec forbids it. Here is the rule and the alternative.
Terms
Agent identity, Dynamic client registration, Least privilege for agents, MCP client, Non-human identity (NHI), OAuth 2.1, Per-user OAuth, Token passthrough