← statichum.studio

Drop-in MCP enterprise auth for Microsoft Entra ID — no hand-rolled DCR proxy, with automatic re-auth on token expiry

dev tool real project •• multiple requests

Developers building Model Context Protocol servers for enterprises keep hitting the same wall: the MCP auth spec assumes OAuth Dynamic Client Registration (DCR), but Microsoft Entra ID — the dominant enterprise IdP — doesn't support DCR, so each builder hand-rolls a proxy that injects a fixed client_id and pretends to the client that DCR works. On top of that, clients like OpenAI Codex dead-end when a refresh token expires, halting with a manual re-auth prompt instead of recovering. The opening is a drop-in SDK/gateway that gives spec-compliant proxy-with-fallback for Entra plus robust automatic re-auth, so builders stop rebuilding the same shim.

builder note

Don't pitch 'an MCP auth gateway' generically — the sharp wedge is the two specific failures people name: Entra-no-DCR (a clean proxy-with-fallback that handles the app-registration plumbing for the builder), and clients that halt on an expired refresh token instead of recovering. The auto re-auth loop is the part even OpenAI's own client gets wrong today, so nail that.

landscape (3 existing solutions)

The ecosystem agrees Entra can't do DCR and has converged on the same manual OAuth-proxy shim; Anthropic just shipped enterprise-managed auth but Okta-only, leaving the Entra builder experience and the refresh-token-expiry dead-end unsolved.

FastMCP Azure / OAuth Proxy Verified by fetch: 'Since Azure doesn't support Dynamic Client Registration, this integration uses the OAuth Proxy pattern.' It ships the workaround, not a turnkey fix — the developer still manually creates the app registration, client secret, redirect URI, and scopes, and it does not address the expired-refresh-token dead-end.
Anthropic / Okta Enterprise-Managed Authorization (EMA) Announced 2026-06-18 with 'Okta is the first supported identity provider.' Entra ID is not supported and no timeline is given; EMA addresses enterprise consent/audit, not the Entra DCR gap individual server builders hit.
Obot (commercial MCP gateway) Confirms 'Microsoft Entra ID does not support Dynamic Client Registration' and sells a hosted paid gateway as the fix — an external intermediary, not something solo and small-team builders can drop into their own clients/SDKs.

sources (2)

github https://github.com/openai/codex/issues/29630 "Codex does not re-register (DCR) on invalid_client / expired refresh token" 2026-06-23
hn https://news.ycombinator.com/item?id=48595427 "trying to use Microsoft Entra ID auth for an MCP server... I must be an idiot" 2026-06-19
mcpoauthentra-identerpriseagents