developers

Registering MCP Clients with CIMD in Auth0

Learn how Auth0 supports MCP client registration via CIMD.

Say you're building an MCP client that needs to talk to an MCP server protected by Auth0. There's no existing relationship between your client and that server's tenant, so how does the authorization server know who you are before it hands out a consent screen?

For a while, the answer was Dynamic Client Registration (DCR): the client calls the authorization server's /register endpoint, the authorization server stores a new client record, and everyone moves on. It works, but it means every authorization server has to run an open registration endpoint and manage a database of client records it can't fully vet.

The MCP authorization spec now recommends a different mechanism first: Client ID Metadata Document, or CIMD.

This mechanism overcomes concerns related to DCR and allows a client to automatically register itself with an authorization server such as Auth0 the first time a user authorizes it. By the end of this post, you'll know how to verify, secure, and maintain a client registered with Auth0 via CIMD.

At the time of writing, CIMD with dynamic registration is in Early Access.

Why CIMD Exists

DCR solves a real problem: letting a client register itself without a human filling out a form first. But that self-service model has a cost. The registration endpoint has to accept requests from clients it has never seen, which makes it a target for automated registration spam. And every successful registration leaves behind a client record the server has to store, secure, and eventually clean up, indefinitely.

CIMD inverts the approach. Instead of the client submitting metadata to the server, the client publishes its metadata at a URL it controls, and that URL becomes the client_id itself. The authorization server fetches the document when it needs it. There's no registration call, and there's no client record sitting in a database unless the server chooses to keep one.

CIMD registration works differently than Dynamic Client Registration (RFC 7591). There is no /register endpoint on your side or Auth0's. The authorization request itself is the registration trigger.

The mechanism is defined in the IETF Client ID Metadata Document draft, and MCP's own specification has adopted it as the preferred registration path, with DCR downgraded to a backwards-compatibility fallback. If you want the deeper history of why the OAuth working group moved in this direction, we've covered that in this other post. This guide picks up from there and gets your hands on the actual registration flow.

How CIMD Works

A CIMD is a plain JSON document. The MCP specification requires at least three fields: client_id, client_name, and redirect_uris. Here's a minimal example:

{
  "client_id": "https://mcpserver.example.com/client.json",
  "client_name": "Example MCP Tool Server",
  "redirect_uris": [
    "https://mcpserver.example.com/callback"
  ],
  "grant_types": ["authorization_code"],
  "token_endpoint_auth_method": "none"
}

Notice that client_id is the same URL where the document lives. The authorization server treats the URL as proof of identity, because only the domain owner can serve a document at that exact address.

The specification also strictly forbids specific fields. A CIMD can never include client_secret or any shared-secret authentication method (client_secret_post, client_secret_basic, client_secret_jwt). That makes sense once you think about what a shared secret would mean here: there's no private registration channel to deliver it over. Everything in the document is public by design, so authentication has to rely on asymmetric cryptography (private_key_jwt) or none at all for public clients.

The Discovery Mechanism

CIMD isn't a one-time registration event. It's a runtime lookup that happens on authorization requests. And that lookup is also the registration. Let's walk through what Auth0 actually does by following the steps in this diagram:

Dynamic CIMD flow diagram

  1. The client sends an authorization request with its metadata URL as client_id. No prior call to a registration endpoint.
  2. Auth0 recognizes that client_id is a URL rather than an opaque identifier.
  3. If it already has fresh, cached metadata for that URL, it uses the cached copy and skips to step 5.
  4. Otherwise, Auth0 issues a GET request to that exact URL.
  5. It expects a 200 OK response with a JSON body.
  6. Auth0 validates the URL and the document. The fetched document's own client_id must match the URL it was fetched from, which prevents one client from borrowing another client's metadata. The redirect_uri in the request must appear in the document's redirect_uris list, and the required fields must be present. If validation passes, Auth0 registers the application as a non-validated CIMD client.
  7. Auth0 shows the user a consent screen that identifies the application by the client_name from the document.
  8. The user approves, Auth0 redirects back with an authorization code, and the client exchanges it for an access token.

One detail matters for how you think about "registered". A dynamically registered client is only persisted once a user successfully completes authorization. Clients that never get that far are held temporarily and removed automatically.

In other words, discovery replaces the database lookup DCR relies on. Instead of checking a client ID in the authorization server's database, Auth0 checks whether the URL provided as a client ID serves a valid document that matches itself. That's a meaningfully different trust model: the server isn't trusting a stored record, it's trusting DNS and TLS at request time.

That trust model comes with its own constraints:

  • Because the server is fetching a URL supplied by an unauthenticated caller, it has to guard against server-side request forgery: the fetch must stay on HTTPS, must not follow redirects, and must not resolve to internal or special-use IP addresses.
  • Responses are also capped in size so a malicious document can't be used to exhaust server resources.

The MCP spec's CIMD section and the IETF draft's security considerations both spell this out, and Auth0's implementation follows the same constraints.

CIMD with Dynamic and Manual Registration

Although an MCP client is registered via CIMD dynamically at the time of the first authorization request, the specifications allow for an authorization server to pre-register the client.

Auth0 supports both registration modes, referring to them as dynamic registration (the default registration we have described so far) and manual registration, respectively.

Both modes use the same document format, the same URL rules, and the same asymmetric-only authentication. What differs is who triggers registration and who reviews changes:

Manual registration Dynamic registration
Registration trigger A tenant admin imports the app from its CIMD URL The app registers itself on its first OAuth request
Metadata refresh Refreshed manually Refreshed automatically
Admin review of changes Admin approves changes before they apply No review; validated changes apply automatically
Key rotation Multiple keys in jwks_uri; refreshed manually Multiple keys in jwks_uri; resolved on demand
Best for MCP clients and integrations you want to vet one by one High-volume or ephemeral clients, such as AI agents

In practice, the choice is about control versus scale. If a human should look at every client before it can ask users for consent, use manual registration. If clients show up faster than anyone can review them, which is the normal situation for MCP, use dynamic registration.

You cannot switch a CIMD client between manual and dynamic once it's registered. You have to delete and re-register it.

Enable Auth0 for CIMD Support

Before a client can register itself, you will need:

  • An Auth0 tenant with CIMD and dynamic registration turned on (details below).
  • A domain you control, served over HTTPS, to host your metadata document.
  • An Auth0 Enterprise plan if you intend to use private_key_jwt for a confidential client. Public clients don't need this. Read here for the difference between public and confidential clients.
  • No active Rules in the tenant. CIMD clients always register as strict third-party applications, and login flows for them fail when Rules are active. If you still use Rules, migrate to Actions first.

Two tenant settings control the feature. In the Dashboard, go to Settings > Advanced, turn on Client ID Metadata Document Registration, then turn on Dynamic CIMD Registration underneath it.

Enable CIMD with dynamic registration in the Auth0 dashboard.

The first toggle also advertises CIMD support in your authorization server metadata, so clients can discover it automatically.

You can set the same two flags through the Management API with PATCH /api/v2/tenants/settings:

{
  "client_id_metadata_document_supported": true,
  "client_id_metadata_document_dynamic_registration_supported": true
}

Alternatively, you can use the Auth0 CLI as follows:

auth0 api patch tenants/settings --data '{
  "client_id_metadata_document_supported": true,
   "client_id_metadata_document_dynamic_registration_supported": true
}'

The second flag requires the first, and you can't disable the first while the second is on. Either mistake returns a 400 Bad Request with a validation_error.

For MCP clients, we also recommend enabling the Resource Parameter Compatibility Profile in your tenant settings. It lets Auth0 honor the RFC 8707 resource parameter when no audience is provided, which is how MCP clients ask for tokens.

One restriction worth flagging early: Auth0 only supports CIMD for native and regular web applications, and it always registers them as third-party applications, never first-party.

Hosting Your Metadata Document

Let's build a real document for a public MCP client. Since it's a public client, it uses token_endpoint_auth_method: "none" and relies on PKCE instead of a client secret:

{
  "client_id": "https://mcpserver.example.com/client.json",
  "client_name": "MCP Tool Server",
  "description": "MCP server providing tools for data analysis",
  "logo_uri": "https://mcpserver.example.com/logo.png",
  "application_type": "web",
  "grant_types": ["authorization_code", "refresh_token"],
  "redirect_uris": ["https://mcpserver.example.com/callback"],
  "token_endpoint_auth_method": "none",
  "response_types": ["code"]
}

Let's explain the relevant points:

  • client_id and the document's own hosting URL must be identical, down to the scheme and path. A trailing slash mismatch is enough to fail validation.
  • redirect_uris should list every callback URL your client actually uses. Auth0 validates incoming redirect_uri values against this list at authorization time, not just at first registration.
  • grant_types includes refresh_token here because MCP clients typically need long-lived sessions without forcing the user back through consent constantly.
  • application_type must be web or native. Anything else is rejected.
  • description is capped at 140 characters.

Auth0 also applies rules to the URL itself, and they're strict. The URL must use https://, can't point at localhost, 127.0.0.1, or ::1, must have a path beyond the root /, and can't contain a query string, fragment, credentials, or dot segments. It also can't be longer than 120 bytes. The metadata document is capped at 5KB, a jwks_uri document at 12KB, and neither may redirect. Properties Auth0 doesn't support are ignored and reported as warnings rather than errors. Check out the CIMD validation rules for a complete reference.

Host this file at the exact URL in client_id, served with a 200 status and the correct content type. In dynamic mode, that is everything you do before the first request. There's nothing to submit to Auth0.

Registering Dynamically: Your First Authorization Request

Registration happens when your client starts a normal authorization code flow with PKCE and uses the CIMD URL as its client_id:

https://YOUR_AUTH0_DOMAIN/authorize
  ?response_type=code
  &client_id=https://mcpserver.example.com/client.json
  &redirect_uri=https://mcpserver.example.com/callback
  &code_challenge=YOUR_CODE_CHALLENGE
  &code_challenge_method=S256
  &resource=https://api.example.com/mcp

Here's what to look at:

  • client_id is your document URL (it must be URL-encoded).
  • redirect_uri has to match an entry in the document.
  • code_challenge and code_challenge_method are required because public CIMD clients must use PKCE.
  • resource identifies the MCP server the token is for, which is where the Resource Parameter Compatibility Profile from earlier comes in.

On receiving this, Auth0 runs the discovery steps from earlier: cache check, fetch, validation, and a non-validated client record. The user then sees a consent screen that names your application using client_name. Once they approve and your client exchanges the code at /oauth/token, the access token's client_id claim is your CIMD URL, and the client is persisted.

Verifying the Registration

After a user has completed authorization, look the client up by its CIMD URL:

curl --request GET \
  --url 'https://YOUR_AUTH0_DOMAIN/api/v2/clients?external_client_id=https://mcpserver.example.com/client.json' \
  --header 'Authorization: Bearer YOUR_MANAGEMENT_API_TOKEN'

You should receive a response similar to the following:

[
  {
    "client_id": "Zk3fQ9xYvT1mPaLw8nR2dHcB7sUeJ0oV",
    "name": "Example MCP Client",
    "description": "MCP client for the Example product",
    "logo_uri": "https://mcpserver.example.com/logo.png",
    "app_type": "web",
    "external_client_id": "https://mcpserver.example.com/client.json",
    "external_metadata_type": "cimd",
    "external_metadata_created_by": "client",
    "external_metadata_status": "available",
    "callbacks": [
      "https://mcpserver.example.com/oauth/callback"
    ],
    "grant_types": [
      "authorization_code",
      "refresh_token"
    ],
    "token_endpoint_auth_method": "private_key_jwt",
    "jwks_uri": "https://mcpserver.example.com/.well-known/jwks.json",
    "client_authentication_methods": {
      "private_key_jwt": {
        "credentials": [
          { "id": "cred_1m7sfABoNTTKYwTQ8qt6tX" }
        ]
      }
    },
    "is_first_party": false,
    "oidc_conformant": true,
    "tenant": "YOUR_TENANT"
  }
]

The response includes the Auth0-generated client_id, which is distinct from your CIMD URL, and two fields worth checking:

  • external_metadata_created_by is client for dynamically registered clients (admin means a tenant admin imported it manually)
  • external_metadata_status tells you whether Auth0 could resolve the hosted document: available or unavailable.

A dynamic client that never completed an authorization flow isn't guaranteed to persist, so an empty result right after a failed attempt is expected, not a bug.

Manual Registration in Brief

If you want an admin gate in front of a client, use manual registration instead. In your Auth0 dashboard, go to Applications > Applications, select Create Application > Import from URL, enter the CIMD URL, select Preview to see the mapped fields and any validation warnings, then select Create.

The Management API mirrors that flow with two calls. POST /api/v2/clients/cimd/preview validates the document without creating anything, and POST /api/v2/clients/cimd/register creates the client:

curl --request POST \
  --url 'https://YOUR_AUTH0_DOMAIN/api/v2/clients/cimd/register' \
  --header 'Authorization: Bearer YOUR_MANAGEMENT_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "external_client_id": "https://mcpserver.example.com/client.json"
  }'

Both calls take the CIMD URL as external_client_id. If a manually registered client with that URL already exists, register updates it. If a dynamically registered client with that URL already exists, it fails with 409 Conflict, which is the mode-switching rule from earlier showing up in practice.

Confidential Clients with Private Key JWT Authentication

Public clients cover most MCP scenarios, but if you're running a server-side MCP client that can protect a private key, you can register it as a confidential client using Private Key JWT authentication. This requires an Enterprise plan.

In this case, your client's CIMD will specify private_key_jwt as the authentication method:

{
  ...
  
  "token_endpoint_auth_method": "private_key_jwt",
  "jwks_uri": "https://mcpserver.example.com/.well-known/jwks.json"
}

The jwks_uri has to share the exact same origin (scheme, host, and port) as the CIMD URL. Auth0 won't accept a JWKS hosted on a different domain, since that would break the identity guarantee the whole mechanism depends on.

Key rotation is where dynamic registration mode proves truly useful. Generate a new key pair with a new kid and publish it in your hosted JWKS. Reusing an old kid with a new key is rejected, which prevents a compromised key from being silently swapped in. Auth0 fetches the new keys on its own: when it can't find the kid it needs during token validation, it re-fetches your jwks_uri on demand. No dashboard action is needed.

That also means dynamically registered clients have no stored credential records.

Post-Registration: API Access and Connections

CIMD-registered clients are always third-party applications, which changes how you grant them API access. You'll configure either a per-application grant (under Applications > APIs > [Your API name] > Application Access) or a default third-party grant on the API itself, with per-application grants taking precedence when both exist. Third-party apps also only work with domain-level connections, so you'll need to enable Promote Connection to Domain Level on any connection this client should use.

Because dynamic clients can appear without anyone creating them, tenant administrators can use Application Profiles to apply consistent settings, such as refresh token lifetimes and Organizations behavior, instead of tuning each client individually. The CIMD registration docs cover the full set of options if your setup needs more than the defaults.

Keeping Metadata in Sync

The hosted document stays the source of truth, and in dynamic registration mode Auth0 keeps up with it for you. It re-fetches the metadata document when a client is first seen, when its cached copy is missing, and when something in an OAuth request fails validation, such as a redirect_uri that isn't in the cached document. Frequently used clients are also refreshed in the background before they go stale, so active users don't wait on a live fetch. Metadata and signing keys refresh on separate schedules, because keys rotate far more often.

If your metadata URL becomes unreachable or invalid, Auth0 suspends attempts rather than retrying on every request. The client's external_metadata_status becomes unavailable, and authorization requests for it fail until the document can be resolved again. It recovers by itself once the URL is healthy, with no manual action.

There is a trade-off to be honest about. Manual registration mode puts an admin between a metadata change and its effect. Dynamic registration mode doesn't: validated changes apply automatically, to every tenant using that client. Your hosted file is now part of your production surface, so protect the domain and the deployment path that serves it accordingly.

One point to note: the CIMD URL itself is the client's identity. If you change the URL, and you haven't updated the client, you've created an entirely new one with no relationship to the old registration. If you need to move your metadata to a new domain, plan for a real client migration, not an in-place edit.

What You've Got Now

You've set up an MCP client that Auth0 registers by itself, the first time a user authorizes it, using a URL you control instead of a registration endpoint, a stored record you provisioned, or a shared secret. That's a meaningful shift for anyone running more than a handful of MCP client deployments: there's nobody to ask for access, no secret to rotate across environments, and the client's identity lives in infrastructure you already control (your own domain and TLS certificate).

If you're setting up the server side of this relationship too, the Auth0 Auth for MCP docs walk through configuring an MCP server as a protected resource, including how it advertises CIMD support to clients like the one you just built.

About the author

Andrea Chiarelli

Andrea Chiarelli

Principal Developer Advocate

I have over 20 years of experience as a software engineer and technical author. Throughout my career, I've used several programming languages and technologies for the projects I was involved in, ranging from C# to JavaScript, ASP.NET to Node.js, Angular to React, SOAP to REST APIs, etc.

In the last few years, I've been focusing on simplifying the developer experience with Identity and related topics, especially in the .NET ecosystem.

View profile