cd /news/agent-protocols/how-can-mcp-oauth-clients-skip-pre-r… · home › topics › agent-protocols › article
[ARTICLE · art-180391] src=pub.towardsai.net ↗ pub= topic=agent-protocols verified=true sentiment=· neutral

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

The MCP project has stopped recommending Dynamic Client Registration (DCR, RFC 7591) and now points implementers toward Client ID Metadata Documents (CIMD), which publish client metadata JSON at a stable HTTPS URL and use that URL as the client_id so authorization servers can fetch and validate it without pre-registration. The guidance sits on an OAuth 2.1 baseline with PKCE, still not formally finalized at the time of writing, plus Protected Resource Metadata (PRM) for resource servers and Authorization Server Metadata (ASM) for authorization servers. DCR's two pain points drove the shift, and most MCP clients are public clients using PKCE that need no client_secret.

key takeaway

Use an HTTPS URL as the client_id and host the client metadata JSON there instead of calling a DCR /register endpoint, since MCP no longer prefers DCR and public PKCE clients need no client_secret.

by read6 min views12 publishedDec 2, 2026

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.

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

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.

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:

POST /register HTTP/1.1Host: auth.example.comContent-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:

HTTP/1.1 201 CreatedContent-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:

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:

{  "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:

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

This demo relies on three main pieces:

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.

<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:

import asynciofrom client_logging import enable_client_loggingfrom fastmcp import Clientfrom fastmcp.client.auth import OAuthasync 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:

{	"resource":"http://localhost:8000/mcp",	"authorization_servers":["http://localhost:8000/"],	"scopes_supported":["read"],	"bearer_methods_supported":["header"]}
{	"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?

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.

I’m Chris Bao, a software engineer focused on Azure and AWS AI platforms, with hands-on work across cloud AI services and agent development.

I offer training and consulting for teams and individuals. Reach out at baoqger@gmail.com.

How Can MCP OAuth Clients Skip Pre-Registration — From DCR to CIMD was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.

── more in #agent-protocols 4 stories · sorted by recency
── more on @mcp 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-can-mcp-oauth-cl…] indexed:0 read:6min 2026-12-02 · —