Live on Product Hunt Intraface launched today. Less steering, more vacations. See the launch
Start for free

What is MCP OAuth?

MCP OAuth is the sign-in flow the Model Context Protocol defines for remote servers. The agent's client discovers the server's authorization server from metadata, sends you to a browser to approve, and gets an access token back using OAuth 2.1 with PKCE. You never copy an API key, and you can revoke the token later.

Part of Glossary: the terms behind MCP, coding agents and shared pages, defined plainly.

How it works

The MCP client finds the sign-in page, you approve in the browser, and the client gets a token it sends with every request.youMCP clientyour agent's appsign-in pagethe authorization serverremote MCP server1. first request, no token2. sign in here3. opens your browser4. sign in, click Allow5. token6. requests, with token
  1. The client calls the MCP server without a token. The server answers that sign-in is needed and says where its sign-in page is.

  2. The client reads that metadata and registers itself with the authorization server, if it hasn't before.

  3. Your browser opens on the sign-in page. You sign in and click Allow.

  4. The client trades the code it gets back, plus a secret only it knows (PKCE), for an access token.

  5. From then on it sends the token as a Bearer header on every request. Revoke the token on the server's side and the agent is signed out everywhere.

Source: MCP specification: authorization

Example: signing in to Intraface

Intraface runs its own authorization server at app.intraface.cc. When Claude Code, Codex or another agent connects for the first time, it learns from the server that sign-in is needed, opens your browser, and you click Allow. The token the agent gets is an Intraface agent token with three permissions: read boards, write boards and write comments. You can see every token under Settings, then Agents, and revoke any of them. A token also lapses on its own after 90 days without use.

Not every agent can finish this flow with every server yet. An agent that cannot complete the browser step uses a token in a header instead, which you create on the same Settings page.

Compared with API keys and header tokens

A static token in a header is simpler to build and fine for scripts. It's worse for people: someone has to create it, paste it somewhere and remember to rotate it, and whoever reads the file can act as them. MCP OAuth moves all of that into one approval screen, gives the service a token it can scope and revoke per person and per agent, and keeps secrets out of config files that get committed by accident.

Why it matters

Agents act on your behalf, so the sign-in decides what they can touch. OAuth scopes let a server hand out only what the agent needs, and the person approving sees exactly what that is. When a laptop is lost or someone leaves, revoking one token ends that agent's access without changing anything on anyone else's machine.

Common mistakes

  • Stopping at "needs authentication". That status is the normal first step. Run the client's sign-in command, finish in the browser, and the server starts answering.
  • Pasting a token into a shared config. If a project file is checked in, use the client's environment-variable syntax or its secret prompt rather than the raw token.
  • Confusing the sign-in with the MCP server. The server that holds the data and the page where you sign in can be the same service, as with Intraface, or two different ones. The client follows the metadata either way.

FAQ

Why does MCP use OAuth instead of API keys?
A key has to be created, copied into a config file and rotated by hand, and anyone who reads the file can use it. With OAuth the person approves the agent once in a browser, the client stores the token, and the service can revoke it without touching anyone's machine.
Does every MCP server need OAuth?
No. Authorization is optional in the spec. Local servers get credentials from the environment instead, and some remote servers accept a static bearer token in a header.
What is PKCE for in MCP OAuth?
It proves that the app finishing the sign-in is the same one that started it. The client sends a hash of a secret it made up, then the secret itself, so a stolen authorization code is useless on its own.

Stop sending HTMLover Slack.

Create an account in a minute, connect your coding agent, and make your first board.