part 1Foundations: before OAuth·lesson 1.2 of 5·5 min read
If I already have a token, why OAuth?
If every request ends up carrying Authorization: Bearer <token> anyway, what does OAuth add? This lesson answers the question that gives meaning to the whole course: the token is the result, OAuth 2.1 is the process for obtaining it, and that process is what lets an MCP client connect to a server it has never seen before.
In this lesson
Understand that the token is the result and OAuth is the process for obtaining it.
Name the six practical differences between a static token and an OAuth token.
Recognize when a static token is good enough.
The starting confusion
Look at these two requests to an MCP server:
With a static token
POST /mcp HTTP/1.1
Host: mcp.example.com
Authorization: Bearer sk_live_9f8a7b6c5d
Content-Type: application/json
With an OAuth token
POST /mcp HTTP/1.1
Host: mcp.example.com
Authorization: Bearer eyJhbGciOiJSUzI1NiIs...
Content-Type: application/json
They are the same! In both cases what travels is Authorization: Bearer <token>. Hence the question: "if in the end I send a token, what does OAuth bring?".
Compare the life of each token
Static token
You log into the service's web dashboard and click "Generate API key".
You copy the string sk_live_9f8a….
You open the configuration of Claude Desktop (or whatever client) and paste it into a JSON file.
You repeat step 3 in every client and on every machine where you use it.
The token works forever (until you delete it by hand) and usually carries all your permissions.
If it leaks (a commit, a log, a stolen laptop), whoever has it is you until you notice.
OAuth token
You add the MCP server's URL to the client. Nothing else.
The client tries to connect, gets a 401 and discovers on its own whom to ask for permission.
Your browser opens on the provider's website: you sign in there (the client never sees your password) and approve "read issues".
The client receives a token that expires in, say, 1 hour, is only valid for that MCP server and only allows reading issues.
When it expires, the client renews it on its own with a refresh token.
If it leaks, the damage is bounded in time, permissions and server; and it can be revoked without changing your password.
The six differences that matter
Aspect
Static token / API key
OAuth 2.1 token
How does it reach the client?
Copy and paste by hand
The client obtains it by following a flow it discovers
Does it expire?
Usually not
Yes, in minutes or hours; renewed automatically
What permissions does it have?
Usually "everything"
Only the approved scopes
Where is it valid?
Wherever you accept it
On a single MCP server (audience, RFC 8707)
Does the client see your password?
No, but the token is equivalent to it
No; you approve on the provider's website
Can an MCP client that does not know the server use it?
Only if someone configures it by hand
Yes: it is the only path a standard client completes without configuration
The real problem it solves: the unknown client
Put yourself in the place of an MCP client like Claude Desktop. It can connect to thousands of servers it does not know in advance. Without a standard, each server would invent its own way to authenticate ("put the key in X-API-Key", "use Basic auth", "send a cookie") and the client would have to know beforehand how each one works. That is exactly what happened in the 2024-11-05 revision (see lesson 4.4).
OAuth 2.1, together with the discovery standards (Part 3), means the client only needs the MCP server's URL. Everything else (whom to ask for the token, where, how to register, which permissions to request) it figures out on its own.
Bird's-eye view: what OAuth does before the token
1. Attempt without a token
MCP client → MCP server
The client calls the MCP server as if nothing were needed.
2. "I don't know you" (401)
MCP server → MCP client
The server responds 401 and tells it where to read how to authenticate.
3. Discovery
MCP client → Authorization server
The client reads a few JSON documents at /.well-known/… paths and finds out who issues tokens and at which URLs.
4. The user approves
User → Authorization server
In the browser, the user signs in at the authorization server and approves the permissions.
5. The token arrives
Authorization server → MCP client
The client receives a temporary token, with bounded permissions and valid only for that MCP server.
6. Now: Bearer
MCP client → MCP server
From here on, every request carries Authorization: Bearer <token>. Just like with a static token… but everything before it happened automatically and securely.
Summary
In both cases Authorization: Bearer … is what travels: the difference lies in how it is obtained and what it limits.
An OAuth token is temporary, scoped, bound to one server, revocable and obtained without copy and paste.
The big problem it solves in MCP: letting a client that does not know the server authenticate without manual configuration.
quiz · 3 questions
1. Which is the best description of the relationship between OAuth and the Bearer token?
The Bearer token travels the same way in both cases. OAuth defines how it is obtained: who issues it, for which server, with what permissions and for how long.
2. You have a generic MCP client and are given only the URL https://mcp.example.com/mcp. Which of these options lets it authenticate without anyone configuring anything?
Custom mechanisms are not discoverable: the client cannot know which header to use or where to get the value. OAuth 2.1 is the only one the MCP spec standardizes and that a client can complete on its own.
3. A token leaks into a public log. In which case is the damage usually smaller?
Expiry, scopes and audience limit what the attacker can do and for how long. An API key is usually permanent and carries every permission.