Understanding Authorization in MCP changeddocs/2026-07-28/tutorials/security/authorization
Nearest release: v2.1.326, published 14 hours after upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 16 Nov 2026 04:15 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 16 Nov 2026 04:37 UTC.
Upstream edited
Recorded here
Lines+15added
Lines−32removed
From line
39
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits9to this page, all time
### Dynamic Client Registration
The whole hunk
from line 39, old and new numbered
/
from line 39
3939 M-->>C: authorization_servers, scopes_supported
4040 C->>A: GET authorization server metadata
4141 A-->>C: Endpoints and capabilities
42 Note over C,A: Client identifies itself:<br/>pre-registered ID, metadata document, or DCR
42 Note over C,A: Client identifies itself:<br/>pre-registered ID or metadata document
4343 Note over C: Record the issuer
4444 C->>B: Open authorization URL<br/>(PKCE challenge, resource, scope)
4545 B->>A: User logs in and consents
from line 194
194194| - | - |
195195| **Pre-registration** | The client already has credentials for this authorization server |
196196| **Client ID Metadata Documents** | Client and server have no prior relationship (most common) |
197| **Dynamic Client Registration** | Deprecated. For authorization servers that don't support Client ID Metadata Documents |
198197
199A client that supports all three should try them in that order. If none is available, it should ask the user to enter the client information. See [Client Registration](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration.md).
198A client that supports both should try them in that order. If neither is available, it should ask the user to enter the client ID, and the client secret if there is one, of a client registered with the authorization server. See [Client Registration](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration.md).
200199
200> [!WARNING]
201>
202> Dynamic Client Registration (DCR) is [deprecated](https://modelcontextprotocol.io/specification/2026-07-28/deprecated.md) as of protocol version `2026-07-28`. New implementations should use [Client ID Metadata Documents](#client-id-metadata-documents) (CIMD) instead.
203>
204> Existing clients can [fall back to DCR](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration.md#dynamic-client-registration) before asking the user for a client ID and secret. This is applicable if the authorization server doesn't support CIMD and allows clients to register at runtime through its `registration_endpoint`.
205
201206### Client ID Metadata Documents
202207
203208With a [Client ID Metadata Document](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-client-id-metadata-document-00) (CIMD), the client uses an HTTPS URL as its `client_id` and hosts a JSON document there. The authorization server fetches the document and validates it when it receives an authorization request.
from line 226
221226
222227The client ID is set up in advance, along with credentials if they're needed. They can be built into the client or entered by the user.
223228
224### Dynamic Client Registration
229Credentials belong to the authorization server that issued them. Clients must store them by `issuer` and never use them with another one. See [Authorization Server Binding](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration.md#authorization-server-binding).
225230
226> [!WARNING]
227>
228> Dynamic Client Registration (DCR) is deprecated. New implementations should
229> use Client ID Metadata Documents instead. DCR remains available for backwards
230> compatibility with authorization servers that don't support them.
231
232With [DCR](https://datatracker.ietf.org/doc/html/rfc7591), the client posts its metadata to the authorization server's `registration_endpoint` and receives a client ID. Clients must include an appropriate `application_type`:
233
234```json theme={null}
235{
236 "client_name": "Example MCP Client",
237 "redirect_uris": ["http://127.0.0.1:8090/callback"],
238 "grant_types": ["authorization_code", "refresh_token"],
239 "response_types": ["code"],
240 "token_endpoint_auth_method": "none",
241 "application_type": "native"
242}
243```
244
245Pre-registered and DCR credentials belong to the authorization server that issued them. Clients must store them by `issuer` and never use them with another one. See [Authorization Server Binding](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration.md#authorization-server-binding).
246
247231## Choosing an Authorization Server
248232
249Use an existing identity provider or authorization server product. Client registration happens between the client and the authorization server, so your MCP server needs no CIMD or DCR code.
233Use an existing identity provider or authorization server product. Client registration happens between the client and the authorization server, so your MCP server needs no registration code.
250234
251235Check these points before you choose one:
252236
from line 714
730714
731715Also open your `METADATA_URL` and check that it contains `code_challenge_methods_supported`. Some clients work without it and others refuse to connect.
732716
733Then run the full flow with the [MCP Inspector](https://modelcontextprotocol.io/docs/2026-07-28/tools/inspector/authorization.md), which needs Node.js 22.19 or later. The command below opens a browser for login and calls the tool:
717Then run the full flow with the [MCP Inspector](https://modelcontextprotocol.io/docs/2026-07-28/tools/inspector/authorization.md), which needs Node.js 22.23.4+, 24.22.1+, or 26.12.1+. The command below runs the login flow and calls the tool:
734718
735719```bash theme={null}
736720npx @modelcontextprotocol/inspector --cli http://localhost:3000/mcp --transport http \
from line 725
741725
742726`--protocol-era modern` makes the Inspector use the 2026-07-28 protocol.
743727
744The Inspector's redirect URI is `http://127.0.0.1:6276/oauth/callback`. `--client-metadata-url` is the URL of a metadata document that you host, with this redirect URI in its `redirect_uris`. If your authorization server supports DCR and accepts registration from your machine, you can leave this option out. For a pre-registered client, register the redirect URI and use `--client-id` instead, with `--client-secret` if the client has a secret.
728By default, the Inspector's redirect URI is `http://127.0.0.1:6276/oauth/callback` (change it with `--callback-url`; it must be a loopback address). `--client-metadata-url` is the URL of a metadata document that you host, with this redirect URI in its `redirect_uris`. The authorization server must be able to fetch it. For a pre-registered client, register the redirect URI and use `--client-id` instead, with `--client-secret` if the client has a secret.
745729
746730You can also connect from a client such as [Visual Studio Code](https://code.visualstudio.com). Run **MCP: Add Server** from the Command Palette, choose HTTP, and enter `http://localhost:3000/mcp`.
747731
from line 737
753737> * **The metadata document is invalid.** Its `client_id` must be identical to its URL, including any trailing slash. The redirect URI in the request must be in `redirect_uris`. Authorization servers should accept any port for a loopback IP address, but some compare the port too.
754738> * **The authorization server rejects the `resource` value.** Register your server's URL exactly as clients send it, including the path and any trailing slash. The error might be `invalid_target`.
755739> * **The Inspector prints `auth_required` after a successful login.** Your server refused the new token. The command prints the same message for a `401` and a `403`. To see which one it is, send the token with `curl -i -X POST http://localhost:3000/mcp -H "Content-Type: application/json" -H "Authorization: Bearer <token>"`.
756> * **The Inspector still fails after you fix the configuration.** It keeps tokens and registered clients between runs. Add `--relogin` to discard them.
740> * **The Inspector still fails after you fix the configuration.** It keeps tokens and client details between runs. Add `--relogin` to discard them.
757741> * **Every token gets a `401`.** Decode a test token. `iss` must be exactly the same as `ISSUER`, and `aud` must contain exactly the expected audience, `http://localhost:3000/mcp` in the examples. If the token isn't a JWT, see [Opaque Tokens](#opaque-tokens). Check too that the clocks of the two servers agree.
758742> * **Every token gets a `403`.** If the response has an `insufficient_scope` error, the token's `scope` claim doesn't contain `mcp:tools`. Some authorization servers use a claim such as `scp`, or an array instead of a string. Change the code that reads the claim. If the token uses a shorter name than clients request, convert it to the full name there. If there is no such error, the `Host` or `Origin` header might have been refused. For a refused `Host`, the Python SDK answers `421` and ASP.NET Core answers `400`.
759743> * **The client refuses to start the flow.** Check that the authorization server metadata has `code_challenge_methods_supported` and that its `issuer` matches the PRM document.
from line 761
777761* **Return `5xx` during an outage**. If your server can't reach the JWKS or introspection endpoint, return a `5xx` status, as the TypeScript and Python examples do. The C# example does this only until it has downloaded the keys once. A `401` makes users log in again, and that doesn't fix the problem.
778762* **Separate client and server credentials**. Don't use your MCP server's introspection credentials in end-user flows.
779763* **Don't log credentials**. Remove `Authorization` headers, tokens, authorization codes, and secrets from your logs. Return generic errors to clients and keep the details in your own logs.
780* **Restrict Dynamic Client Registration**. Anyone can register with an open `registration_endpoint`, so add controls such as trusted hosts and rate limits.
764* **Restrict Dynamic Client Registration**. If your authorization server supports [DCR](#client-registration-approaches) with an open `registration_endpoint`, anyone can register a client. Disable DCR if your clients don't depend on it. Otherwise, restrict registration with controls such as trusted hosts and rate limits.
781765
782766## Related Standards and Documentation
783767
from line 774
790774* **[RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707)**: Resource Indicators
791775* **[RFC 9207](https://datatracker.ietf.org/doc/html/rfc9207)**: Authorization Server Issuer Identification
792776* **[OAuth Client ID Metadata Document](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-client-id-metadata-document-00)**: Client IDs that are URLs
793* **[RFC 7591](https://datatracker.ietf.org/doc/html/rfc7591)**: Dynamic Client Registration
794777* **[RFC 6750](https://datatracker.ietf.org/doc/html/rfc6750)**: Bearer Token Usage
795778
796779For more details, see:
No line in this hunk matches that.