MCP tool "Dynamic Discovery" OAuth crashes with internal server error — never queries the authorization server

Mardiyyah Oduwole 0 Reputation points
2026-08-26T13:00:31.96+00:00

I'm connecting a Copilot Studio agent to a custom MCP server, added via Tools → Add a tool → Model Context Protocol (URL only, no manual auth config — the built-in auto-discovery path). The MCP server requires OAuth; sign-in should happen automatically via RFC 9728 protected-resource metadata + RFC 8414 authorization-server discovery.

Symptom: When the agent tries to invoke the tool, it prompts the connection flow, then fails with:

Encountered internal server error. The correlation Id is '<your correlation ID>'.

What I've verified with server-side logs on both ends:

  1. Copilot Studio calls GET /mcp on my server → gets 401 with a WWW-Authenticate header pointing to /.well-known/oauth-protected-resource/mcp (per RFC 9728). Confirmed in my server's access logs.
  2. Copilot Studio then fetches /.well-known/oauth-protected-resource/mcp → gets a 200 with valid JSON, including an authorization_servers entry pointing to my authorization server. Confirmed in my server's access logs.
  3. That authorization server's own /.well-known/oauth-authorization-server document is independently confirmed reachable and spec-correct (RFC 8414) — it advertises a working registration_endpoint, token_endpoint_auth_methods_supported including both public and confidential clients, and PKCE (S256).
  4. The authorization server's access logs show zero incoming requests — not to .well-known/oauth-authorization-server, not to the registration endpoint. Nothing. Copilot Studio never attempts to contact it after step 2.
  5. I tested whether a trailing slash on the authorization_servers URL (added by pydantic's URL normalization on my server) was tripping up discovery, by removing it. Identical failure with or without the trailing slash — ruled out.

So the failure happens entirely inside Copilot Studio, between successfully reading my protected-resource metadata and ever attempting to reach the authorization server it just learned about — with no further outbound requests at all.

Microsoft Copilot | Other
0 comments No comments

2 answers

Sort by: Most helpful
  1. Mardiyyah Oduwole 0 Reputation points
    2026-08-27T14:33:16.0166667+00:00

    UPDATE: This was VPN/network gating on our own Enterprise AS, not a Copilot Studio bug. It was confirmed by making it reachable and getting a full successful flow through, including a real tool call.

    Was this answer helpful?

    0 comments No comments

  2. Sayali-MSFT 6,486 Reputation points Microsoft External Staff Moderator
    2026-08-27T09:08:46.2533333+00:00

    Hello @Mardiyyah Oduwole ,
    The server-side evidence indicates that the RFC 9728 challenge and protected-resource metadata discovery are completing successfully, but Copilot Studio fails before making any RFC 8414 discovery or dynamic client-registration request to the advertised authorization server. This rules out the trailing slash, token endpoint, PKCE, redirect URI, audience, and authorization-server availability as the immediate cause. The issue is most likely within Copilot Studio’s dynamic OAuth discovery processing or an undocumented authorization-server compatibility restriction.can u share with the correlation ID, UTC timestamp, environment/agent details, sanitized discovery documents, and logs from both servers so engineering can inspect the backend failure immediately after protected-resource metadata parsing.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.