{"slug": "how-can-mcp-oauth-clients-skip-pre-registration-from-dcr-to-cimd", "title": "How Can MCP OAuth Clients Skip Pre-Registration — From DCR to CIMD", "summary": "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.", "body_md": "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.\n\nAccording to MCP’s recommendations, authorization is built from these building blocks:\n\nOAuth 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.\n\nMCP 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.\n\nBoth 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.\n\nBut 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.\n\nASM 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.\n\nFor dynamic client registration, MCP defines two options: Dynamic Client Registration Protocol (DCR) or Client ID Metadata Documents (CIMD).\n\n**DCR**\n\nDCR 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:\n\n```\nPOST /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\"]}\n```\n\nThe server validates the payload, persists the client, and returns identifiers — often including a client_id:\n\n```\nHTTP/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\"]}\n```\n\nNote 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.\n\nDCR was the first recommended dynamic-registration path in the MCP authorization world — but it comes with two pain points:\n\nBecause of that, the MCP project no longer prefers DCR and points implementers toward CIMD instead. Smart design, right?\n\n**CIMD**\n\nCIMD 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:\n\n```\n{  \"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\"}\n```\n\nWhen 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.\n\nThat cuts down registry churn on the authorization server, but the bigger win is security.\n\nTrust 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:\n\nNext step, let us see this in a hands-on demo.\n\nThis demo relies on three main pieces:\n\n**Azure API Gateway configuration**\n\nWe created a gateway at [https://mcp-cimd-test.azure-api.net:](https://mcp-cimd-test.azure-api.net:)\n\nOn 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.\n\n```\n<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>\n```\n\n**MCP client implementation**\n\nOn the client, we set client_metadata_url to the gateway endpoint above:\n\n``` python\nimport 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())\n```\n\nWhen you run the client, the consent UI highlights domain-based trust — a hallmark of the CIMD mode.\n\n**MCP server logs**\n\nThe server side is more involved; I will save a dedicated deep dive for a future article. For now, the logs tell the real story:\n\nFrom the log sequence you can read the authorization path end to end:\n\n```\n{\t\"resource\":\"http://localhost:8000/mcp\",\t\"authorization_servers\":[\"http://localhost:8000/\"],\t\"scopes_supported\":[\"read\"],\t\"bearer_methods_supported\":[\"header\"]}\n{\t\"issuer\":\"http://localhost:8000/\",\t\"authorization_endpoint\":\"http://localhost:8000/authorize\",\t\"token_endpoint\":\"http://localhost:8000/token\",\t\"registration_endpoint\":\"http://localhost:8000/register\",\t\"scopes_supported\":[\"read\"],\t\"response_types_supported\":[\"code\"],\t\"grant_types_supported\": [\"authorization_code\",\"refresh_token\"],\t\"token_endpoint_auth_methods_supported\":[\"none\",\"private_key_jwt\"],\t\"code_challenge_methods_supported\":[\"S256\"],\t\"client_id_metadata_document_supported\":true,\t\"authorization_response_iss_parameter_supported\":true}\n```\n\nThe 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?\n\nMCP 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.\n\nEarly 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.\n\nOur 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.\n\nI will go deeper into server-side code in a follow-up article — stay tuned if you want the full implementation breakdown.\n\nI’m Chris Bao, a software engineer focused on Azure and AWS AI platforms, with hands-on work across cloud AI services and agent development.\n\nI offer training and consulting for teams and individuals. Reach out at [baoqger@gmail.com](mailto:baoqger@gmail.com).\n\n[How Can MCP OAuth Clients Skip Pre-Registration — From DCR to CIMD](https://pub.towardsai.net/how-can-mcp-oauth-clients-skip-pre-registration-from-dcr-to-cimd-74b7199052cb) was originally published in [Towards AI](https://pub.towardsai.net) on Medium, where people are continuing the conversation by highlighting and responding to this story.", "url": "https://wpnews.pro/news/how-can-mcp-oauth-clients-skip-pre-registration-from-dcr-to-cimd", "canonical_source": "https://pub.towardsai.net/how-can-mcp-oauth-clients-skip-pre-registration-from-dcr-to-cimd-74b7199052cb?source=rss----98111c9905da---4", "published_at": "2026-12-02 17:31:01+00:00", "updated_at": "2026-12-02 18:13:30.968509+00:00", "lang": "en", "topics": ["agent-protocols", "ai-agents", "ai-tools", "developer-tools"], "entities": ["MCP", "Dynamic Client Registration Protocol", "Client ID Metadata Documents", "RFC 7591", "OAuth 2.1", "Protected Resource Metadata", "Authorization Server Metadata", "PKCE"], "also_reported_by": [], "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.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/how-can-mcp-oauth-clients-skip-pre-registration-from-dcr-to-cimd", "markdown": "https://wpnews.pro/news/how-can-mcp-oauth-clients-skip-pre-registration-from-dcr-to-cimd.md", "text": "https://wpnews.pro/news/how-can-mcp-oauth-clients-skip-pre-registration-from-dcr-to-cimd.txt", "jsonld": "https://wpnews.pro/news/how-can-mcp-oauth-clients-skip-pre-registration-from-dcr-to-cimd.jsonld"}}