MCP OAuth checklist
16 things to get right in the auth setup of a remote MCP server. Each item says where the rule comes from and how you can test it.
Items marked with the MCP spec refer to the authorization spec in revision 2026-07-28. Everything marked as good practice is not required by a standard. It is what we look for when we audit a server. You can run most of the list against your own server with the browser scan or the open source CLI:
npx -y @patchbay-nebius/agent audit https://mcp.example.com/mcpDiscovery
A client reads these documents before it does anything else. If they are missing or incomplete the login never starts.
Publish Protected Resource Metadata
The document under /.well-known/oauth-protected-resource names your resource identifier and the authorization servers that issue tokens for it. Clients use it to find where to log in.
- Source:
- MCP spec, RFC 9728
- Test:
- Browser scan and CLI
List S256 in code_challenge_methods_supported
Clients have to verify PKCE support from the authorization server metadata. If the field is absent they must stop before the login.
- Source:
- MCP spec 2026-07-28
- Test:
- Browser scan and CLI
Client registration
An MCP client is whatever the user runs. It needs a client_id without anyone filing a ticket.
Offer an automatic way to register
Support Client ID Metadata Documents, which the current spec recommends, or keep a Dynamic Client Registration endpoint for older clients. With neither, every client has to be added by hand.
- Source:
- MCP spec 2026-07-28
- Test:
- Browser scan and CLI
Accept loopback redirect URIs with any port
CLI and desktop clients listen on a local port that changes on every login. An authorization server that insists on an exact port breaks all of them.
- Source:
- RFC 8252 §7.3
- Test:
- CLI with flag
--probe-dcr-loopback
Treat localhost and 127.0.0.1 the same
Clients use both forms. Accepting one and rejecting the other locks out every client that uses the other form.
- Source:
- Good practice
- Test:
- Browser scan and CLI
Tokens
What the server does with a token once it arrives.
Validate the audience of every token
A token issued for another service behind the same authorization server must not work on your MCP server. Compare the aud claim with your own resource identifier and reject everything else.
- Source:
- MCP spec, RFC 8707 §2
- Test:
- CLI with flag
--probe-audience=<token>
Accept the resource parameter
MCP clients send it on authorization and token requests so the authorization server can bind the token to your server. Make sure yours does not reject or ignore it.
- Source:
- MCP spec, RFC 8707
- Test:
- Check by hand
Do not rely on a static key alone
A long lived bearer token or API key with no OAuth discovery cannot be scoped, rotated per client or bound to an audience.
- Source:
- Good practice
- Test:
- Browser scan and CLI
Exposure
What anyone on the internet can reach without credentials.
Never expose write tools without authentication
A public server for read only lookups can be a deliberate choice. A server that answers tools/list without credentials and offers tools that create, send or delete is open to anyone who finds the URL.
- Source:
- Good practice
- Test:
- Browser scan and CLI
Serve over HTTPS only
Tokens and tool calls over plain HTTP can be read and changed in transit.
- Source:
- Good practice
- Test:
- Browser scan and CLI
Reject requests from origins you do not expect
This matters when browsers can reach the server. Without an origin check a web page the user visits can talk to it.
- Source:
- Good practice
- Test:
- Browser scan and CLI
Scopes
How much a single token can do.
Give tools their own scopes
With one scope for everything, a client that only needs to read gets permission to write as well.
- Source:
- Good practice
- Test:
- Browser scan and CLI
Separate read and write
Read and write tools behind the same scope cannot be granted independently.
- Source:
- Good practice
- Test:
- Browser scan and CLI
In the repository
These need the source code, so they only run in the CLI.
No secrets in source
Keys committed to the repository end up in every clone and every fork.
- Source:
- Good practice
- Test:
- CLI
Give long lived credentials a refresh path
A credential that sits in an environment variable forever cannot be rotated without downtime.
- Source:
- Good practice
- Test:
- CLI
After launch
A server changes. So does what an agent can do through it.
Watch your tool list for changes
Nothing in the spec makes a client ask the user again when a tool is added or its description changes. Pin the manifest and review every difference.
- Source:
- Good practice
- Test:
- CLI
Run the list against your server
Paste the URL and get a report with a grade in a few seconds. Free, no account. The items marked CLI need the command line tool.
Scan a server