How Can MCP OAuth Clients Skip Pre-Registration - From DCR to CIMD

Background

As I mentioned in my previous article, I shared how an MCP service can support the OAuth extension Protected Resource Metadata (PRM). That piece was only one slice of MCP OAuth. The official guidance stacks several more requirements on top—and today we will unpack the rest of the story, with a focus on the client side.

The MCP Authorization Stack

According to MCP’s recommendations, authorization is built from these building blocks:

  • OAuth 2.1
  • RFC 8414 (Authorization Server Metadata, ASM)
  • RFC 9728 (Protected Resource Metadata, PRM)
  • RFC 7591 (Dynamic Client Registration Protocol, DCR) or Client ID Metadata Documents (CIMD)

OAuth 2.1 is the evolution of OAuth 2.0: it keeps the core flows but bakes in modern hardening by default—for example PKCE. It predates the GenAI wave; traditional apps simply needed stronger, safer OAuth as scenarios grew more complex. At the time of writing, OAuth 2.1 is still not formally finalized.

MCP then asks you to layer more extensions on top of that OAuth 2.1 baseline. As we discussed before, PRM helps clients discover resource-side authorization metadata. ASM is the mirror image for the authorization server: a public metadata document so clients can learn endpoints, supported grants, and capabilities without hard-coding them.

Both PRM and ASM are part of the broader OAuth discovery story. The goal is the same: let the client discover everything it needs to start an authorization flow.

But that is only half of the picture. Do not forget the four classic OAuth roles: the user, the authorization server, the resource server, and the client.

ASM and PRM strengthen discovery for the authorization server and the resource server. The client still needs its own answer: in agent-heavy MCP setups, you cannot always pre-register every client up front—so dynamic registration becomes the missing puzzle piece. Let us compare the two approaches MCP offers.

DCR vs CIMD

For dynamic client registration, MCP defines two options: Dynamic Client Registration Protocol (DCR) or Client ID Metadata Documents (CIMD).

DCR

DCR is a mature extension defined in RFC 7591. The authorization server exposes a register endpoint. The client sends a POST with the same metadata you would have submitted during manual registration—for example:

1
2
3
4
5
6
7
8
9
10
POST /register HTTP/1.1
Host: auth.example.com
Content-Type: application/json

{
"client_name": "My MCP Client",
"redirect_uris": ["https://client.example.com/callback"],
"grant_types": ["authorization_code"],
"response_types": ["code"]
}

The server validates the payload, persists the client, and returns identifiers—often including a client_id:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
HTTP/1.1 201 Created
Content-Type: application/json

{
"client_id": "s6BhdRkqt3",
"client_secret": "cf136dc3c1fc93f31185e5885805d",
"client_id_issued_at": 1748534400,
"client_secret_expires_at": 0,
"registration_access_token": "reg-23410913-abewfq.123483",
"registration_client_uri": "https://auth.example.com/register/s6BhdRkqt3",
"redirect_uris": ["https://client.example.com/callback"],
"grant_types": ["authorization_code"],
"response_types": ["code"]
}

Note that a client_secret only shows up for confidential clients that can store secrets safely. Most MCP clients are public clients using PKCE, so they typically do not need a secret at all.

DCR was the first recommended dynamic-registration path in the MCP authorization world—but it comes with two pain points:

  • The authorization server must store and lifecycle-manage a growing pile of registration records—operational overhead adds up fast.
  • Dynamically submitted metadata is hard to authenticate. An attacker can copy a legitimate registration payload and create a look-alike client, which opens the door to phishing-style abuse.

Because of that, the MCP project no longer prefers DCR and points implementers toward CIMD instead. Smart design, right?

CIMD

CIMD takes a clever turn: publish the same client metadata JSON at a stable HTTPS URL, and use that URL as the client_id. The rest of the OAuth flow stays familiar. For example:

1
2
3
4
5
6
7
8
9
{
"client_id": "https://app.example.com/oauth/client-metadata.json",
"client_name": "Example MCP Client",
"client_uri": "https://app.example.com",
"redirect_uris": ["https://app.example.com/callback"],
"grant_types": ["authorization_code"],
"response_types": ["code"],
"token_endpoint_auth_method": "none"
}

When the authorization server sees a client_id that is an HTTPS URL—not an opaque string—it fetches the document from that URL and continues validation from there.

That cuts down registry churn on the authorization server, but the bigger win is security.

Trust comes from HTTPS and control of that URL. When the AS pulls client metadata, it always knows which domain served the document. The domain becomes a foundation for risk and trust decisions—something DCR struggles to replicate at scale:

  • First time a domain shows up, the AS can prompt the user for an extra confirmation step—similar to a browser warning about an unfamiliar download source.
  • If clients under a domain have been authorized widely without incidents, the AS can gradually relax friction for that domain.
  • The AS can maintain an allowlist of verified domains, fast-path trusted tenants, and block suspicious ones.

Next step, let us see this in a hands-on demo.

Demo

This demo relies on three main pieces:

  • FastMCP — MCP client and server
  • Entra ID — OAuth provider. Entra’s CIMD support is still in beta, so FastMCP uses a proxy layer that implements what CIMD expects from the authorization server (more detail below).
  • Azure API Gateway — hosts an API that returns the CIMD registration JSON directly.
Azure API Gateway configuration

We created a gateway at https://mcp-cimd-test.azure-api.net:

On that gateway we defined /mcpcimd/cimd with an inbound return-response policy so GET requests return client metadata. The client_id field must exactly match this URL path.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<policies>
<inbound>
<choose>
<when condition="@(context.Request.Method != "GET")">
<return-response>
<set-status code="405" reason="Method Not Allowed" />
</return-response>
</when>
</choose>
<return-response>
<set-status code="200" reason="OK" />
<set-header name="Content-Type" exists-action="override">
<value>application/json; charset=utf-8</value>
</set-header>
<set-header name="Cache-Control" exists-action="override">
<value>public, max-age=3600</value>
</set-header>
<set-body>@{
return JsonConvert.SerializeObject(new {
client_id = "https://mcp-cimd-test.azure-api.net/mcpcimd/cimd",
client_name = "My Application",
redirect_uris = new[] {
"http://localhost:8765/callback"
},
token_endpoint_auth_method = "none",
grant_types = new[] {
"authorization_code"
},
response_types = new[] {
"code"
}
});
}</set-body>
</return-response>
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>
MCP client implementation

On the client, we set client_metadata_url to the gateway endpoint above:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import asyncio
from client_logging import enable_client_logging
from fastmcp import Client
from fastmcp.client.auth import OAuth

async def main() -> None:
async with Client(
"http://localhost:8000/mcp",
auth=OAuth(
client_metadata_url="https://mcp-cimd-test.azure-api.net/mcpcimd/cimd",
callback_port=8765,
),
) as client:
result = await client.call_tool("get_user_info")
user_info = result.data
print(f"Azure user: {user_info['username']}")
print(f"Name: {user_info['name']}")

if __name__ == "__main__":
asyncio.run(main())

When you run the client, the consent UI highlights domain-based trust—a hallmark of the CIMD mode.

MCP server logs

The server side is more involved; I will save a dedicated deep dive for a future article. For now, the logs tell the real story:

From the log sequence you can read the authorization path end to end:

  1. First connection — the client connects without a token, validation fails, and you see 401.
  2. Resource discovery — the client starts discovery and calls /.well-known/oauth-protected-resource/mcp (PRM):
1
2
3
4
5
6
{
"resource":"http://localhost:8000/mcp",
"authorization_servers":["http://localhost:8000/"],
"scopes_supported":["read"],
"bearer_methods_supported":["header"]
}
  1. Authorization-server discovery — next it calls /.well-known/oauth-authorization-server (ASM):
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"issuer":"http://localhost:8000/",
"authorization_endpoint":"http://localhost:8000/authorize",
"token_endpoint":"http://localhost:8000/token",
"registration_endpoint":"http://localhost:8000/register",
"scopes_supported":["read"],
"response_types_supported":["code"],
"grant_types_supported": ["authorization_code","refresh_token"],
"token_endpoint_auth_methods_supported":["none","private_key_jwt"],
"code_challenge_methods_supported":["S256"],
"client_id_metadata_document_supported":true,
"authorization_response_iss_parameter_supported":true
}

The smoking gun is client_id_metadata_document_supported: true. The authorization server advertises CIMD, so the client chooses CIMD over DCR—you will not see a call to the register endpoint in the logs. Great, right?

  1. Fetch CIMD — the MCP server loads registration metadata from the URL the client supplied and validates it.
  2. Authorize — the authorize request uses our gateway URL as client_id; the rest of the flow is standard OAuth.

Summary

MCP OAuth layers ASM, PRM, and related discovery on top of OAuth 2.1 so clients can map out the authorization chain automatically. Agent scenarios still need dynamic registration, because you cannot pre-register every client against every MCP server you might hit.

Early guidance favored DCR (RFC 7591), but it forces the authorization server to persist client records, raises verification cost, and makes spoofed client metadata easier to abuse. MCP now prefers CIMD: host client metadata at an HTTPS URL, use that URL as client_id, and let the AS fetch and validate—anchoring trust in the domain and TLS.

Our demo exposed CIMD JSON on Azure API Gateway, pointed FastMCP at it via client_metadata_url, and completed authorization with Entra ID (via the CIMD-aware proxy). The logs show the familiar PRM → ASM discovery order, and when client_id_metadata_document_supported is true, the happy path skips register entirely.

I will go deeper into server-side code in a follow-up article—stay tuned if you want the full implementation breakdown.