Skip to content

Custom connector cannot authenticate to first-party Microsoft Entra MCP servers (Business Central, Power BI/Fabric, M365) — OAuth succeeds but Claude never exchanges the code at /token #632

Description

@nalamo1234

What happened?

When adding a first-party Microsoft MCP server (Microsoft Business Central at https://mcp.businesscentral.dynamics.com) as a custom connector in claude.ai, authentication fails even though Microsoft Entra ID reports the sign-in as successful.

The OAuth callback completes and Entra sign-in logs show Status: Success for both the app registration and the Business Central resource. However, the connector then fails with "Authorization with the MCP server failed" (reference ofid_128cd77473218bac). Per detailed HTTP traces in related issue #506, Claude's backend performs OAuth discovery (GET on the .well-known metadata endpoints, both return 200) but never POSTs to the /token endpoint — the authorization code is never exchanged for a token. Because Claude never obtains a token, no authenticated MCP request is ever made.

The same Business Central server, same Entra tenant, same credentials, and same user account connect successfully through three other clients:

This confirms the Business Central server validates correctly-acquired tokens fine. The failure is specific to the claude.ai custom connector's token-acquisition step with Microsoft Entra ID as the authorization server.

Critically, none of the documented customer-side fixes can resolve this for a first-party Microsoft server:

  1. Entra ID does not support Dynamic Client Registration (DCR).
  2. The documented Application ID URI fix (for AADSTS9010010) cannot be applied — Entra requires the Application ID URI to use a verified domain the organization owns, and the customer does not own businesscentral.dynamics.com (Microsoft does). Setting it returns: "Values of IdentifierUris property must use a verified domain of the organization or its subdomain."
  3. oauth_anthropic_creds / custom_connection are documented as "Contact Anthropic" (request submitted to mcp-review@anthropic.com, awaiting response).

Secondary blocker (see #427): even if auth is resolved, BC requires custom headers (TenantId, EnvironmentName, Company, ConfigurationName) that the web connector UI provides no field for.

This affects an entire category of first-party Microsoft servers (Business Central, Power BI/Fabric, Microsoft 365) and any organization using Microsoft Entra ID. Consolidates and continues #397 (closed as not-planned before diagnosis was complete). Related: #427, #290, #496, #503, #506, #520.

What did you expect to happen?

After a successful Microsoft Entra sign-in, Claude should exchange the authorization code at the /token endpoint, obtain an access token, and establish an authenticated MCP session — as it does in Claude Code and as ChatGPT Developer Mode does. The connector should then be usable across claude.ai web, mobile, and Desktop.

Steps to reproduce

  1. In claude.ai, go to Settings > Connectors > Add custom connector.
  2. Enter URL: https://mcp.businesscentral.dynamics.com
  3. Under Advanced settings, enter the OAuth Client ID of a Microsoft Entra app registration (multi-tenant, public client, redirect URIs https://claude.ai/api/mcp/auth_callback and https://claude.com/api/mcp/auth_callback, delegated Business Central permissions with admin consent).
  4. Click Connect and complete the Microsoft sign-in.
  5. Observe: Microsoft sign-in succeeds (Entra logs show Status: Success), but Claude returns "Authorization with the MCP server failed" with an ofid_ reference.

Area

MCP Connector (adding/managing servers)

MCP Server (if applicable)

https://mcp.businesscentral.dynamics.com

Error messages or logs

- Most recent failure reference: ofid_128cd77473218bac
- Consolidates: #397 (closed not-planned)
- Related open issues: #427, #290, #496, #503, #506, #520
- Willing to provide: full mcp-remote bridge logs, decoded token aud claims from a working session, Entra sign-in log exports
- Anthropic connector auth docs referenced for DCR/CIMD/oauth_anthropic_creds/Application ID URI options

Additional context

Actual Behavior
OAuth callback completes and Entra reports success, but Claude's backend never POSTs to /token, never obtains a token, and the connector fails with "Authorization with the MCP server failed" (ofid_128cd77473218bac). The connector remains disconnected. No token ever reaches the Business Central server.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions