Why Remote Servers Ask Who You Are
A local server runs as you, on your machine, so it already knows who you are. The spec tells stdio servers to skip sign-in and "retrieve credentials from the environment" instead.
A remote server takes requests from the whole internet. Homing at https://api.tryhoming.com/mcp has to put a note in your inbox and nobody else's, so every request must carry proof of whose it is. For HTTP servers, the spec's authorization chapter describes one way to get that proof: OAuth.
Follow the Chain
Your client starts with one thing, the server's URL, and discovers the rest. Step through it; the discovery responses are real.
1 Any request
2 401 + metadata URL
HTTP/2 401 www-authenticate: Bearer resource_metadata="https://api.tryhoming.com/.well-known/oauth-protected-resource/mcp", scope="profile email"
3 GET resource metadata
GET /.well-known/oauth-protected-resource/mcp HTTP/1.1
4 Protected Resource Metadata
{ "resource": "https://api.tryhoming.com/mcp", "authorization_servers": ["https://clerk.tryhoming.com"], "bearer_methods_supported": ["header"], "scopes_supported": ["profile", "email"], "resource_name": "Homing" }5 GET server metadata
GET https://clerk.tryhoming.com/.well-known/oauth-authorization-server
6 Server metadata
{ "issuer": "https://clerk.tryhoming.com", "authorization_endpoint": "https://clerk.tryhoming.com/oauth/authorize", "token_endpoint": "https://clerk.tryhoming.com/oauth/token", "code_challenge_methods_supported": ["S256"], "client_id_metadata_document_supported": true, "response_types_supported": ["code"], … }7 Opens your browser
GET https://clerk.tryhoming.com/oauth/authorize ?response_type=code &client_id=https://client.example/oauth/metadata.json &redirect_uri=http://localhost:…/callback &code_challenge=…&code_challenge_method=S256 &scope=profile%20email &resource=https://api.tryhoming.com/mcp
8 Sign in, approve
9 Code
10 POST /oauth/token
POST https://clerk.tryhoming.com/oauth/token grant_type=authorization_code&code=…&code_verifier=… &redirect_uri=http://localhost:…/callback &resource=https://api.tryhoming.com/mcp
11 Access token
12 Retry, with token
POST /mcp HTTP/1.1 Authorization: Bearer …
Steps 2, 4 and 6 are captured from Homing in production on 2026-11-24, trimmed. The rest follows the 2026-07-28 spec, with values cut.
What Each Check Stops
PKCE. The client hashes a secret into code_challenge and reveals the secret only when it redeems the code. A code stolen from a redirect is worthless without it. The spec makes PKCE mandatory and S256 the method.
**The resource parameter.** The client names the MCP server in both the authorize and the token request, and the server "MUST validate that access tokens were issued specifically for them." A token for one server can't be replayed at another, and a server "MUST NOT pass through the token it received" to anything else.
The issuer check. Metadata whose issuer differs from the URL the client built must not be used, so a planted document can't redirect your sign-in.
Header only. "Access tokens MUST NOT be included in the URI query string," where they would end up in logs and browser history.
Scopes, and Asking for More
The client asks for the scopes in the 401's scope, here profile email, and only falls back to scopes_supported when the challenge names none. If a later call needs more, the server answers 403 with insufficient_scope and the scope it wants. The client asks again for the union of what it had and what's missing, with a limit on retries.
API Keys
The authorization chapter only describes OAuth. Plenty of servers also accept a key, for clients that can't open a browser, such as a script on a server or a CI job. Homing does: a key from the app goes in the same Authorization: Bearer header, read from an environment variable rather than pasted into a config file.
A key skips discovery entirely, so it suits machines. It also skips your approval in a browser, so treat it like a password, and revoke it when the job ends. When a key is wrong, Homing's 401 carries no sign-in pointer: signing in wouldn't fix a bad key.
Check Yourself
Questions
How does OAuth work with MCP?
The server answers an unauthenticated request with 401 and a resource_metadata URL. The client reads that metadata to find the authorization server, reads its metadata, sends you to sign in with PKCE, trades the code for a token, and sends the token in the Authorization header on every request.
Does MCP support API keys?
The MCP authorization spec only describes OAuth for HTTP servers. Many servers, Homing included, also accept an API key as a bearer token, for clients that can't open a browser.
Do local MCP servers need OAuth?
No. The spec says servers on the stdio transport should not use it and should read credentials from the environment instead.
Try It
Walk the first half of the chain yourself. Both documents are public; no key needed.
What You Should See
- 1:
authorization_serversnaminghttps://clerk.tryhoming.com. - 2:
["S256"],true, andnullforregistration_endpoint: PKCE with S256, client metadata documents, no dynamic registration.
Sources
For Agents and Search Engines
Sign in from Claude Code, ChatGPT and other clients, or connect with an API key.