Repository navigation
Windows: MCP Entra sign-in fails with "this server's advertised scopes could not be safely validated for the account broker" #5068
Description
Describe the bug
On Windows, authenticating to an Entra ID–protected MCP server (Microsoft's hosted Azure DevOps MCP server, https://mcp.dev.azure.com/{org} , server type http ) fails on every fresh interactive sign-in attempt with:
Authentication failed: MCPOAuthError: Microsoft Entra sign-in for https://mcp.dev.azure.com/{org} failed: this server's advertised scopes could not be safely validated for the account broker
/mcp auth does not open the login/account-picker dialog at all — it fails immediately with the above error.
Affected version
GitHub Copilot CLI 1.0.93-2
Steps to reproduce the behavior
- Configure an MCP server pointing at https://mcp.dev.azure.com/{org} (type http ) via a Copilot CLI plugin.
- Start a new Copilot CLI session.
- Run /mcp auth ado (or whatever the server is named).
- Expected: Windows account picker / browser OAuth dialog opens for Entra sign-in.
- Actual: Dialog never appears; command fails instantly with the "advertised scopes could not be safely validated for the account broker" error.
Expected behavior
when the native broker cannot safely validate a server's advertised scopes, the CLI should fall back to standard browser-based OAuth instead of failing outright, consistent with the documented fallback behavior for "no broker available."
Additional context
- This started suddenly with no local configuration changes on the user's part. CLI terminals that were already open and authenticated from the day before continue to work fine (silent token renewal via acquireTokenSilent still succeeds). Only brand-new sessions attempting a fresh interactive sign-in ( acquireTokenInteractive ) hit this error — suggesting the issue is specific to the interactive WAM/native-broker code path, not silent renewal.
- Deleting all cached OAuth token files under %USERPROFILE%.copilot\mcp-oauth-config*.tokens.json for this server did not resolve the issue.
- The exact error string does not appear anywhere in the CLI's JS bundle ( cli-main.js ), indicating it originates from the native Windows MSAL broker/WAM component ( msalruntime.dll / msal-node-runtime.node ), which performs its own scope-safety validation before invoking the Windows account picker.
- Reproduces identically on CLI 1.0.92 (stable) and 1.0.93-2 (prerelease), which rules out a simple JS-level regression introduced between those versions.
was added, ~1.0.81) that is only now being triggered. - The CLI's own changelog (bundled changelog.json ) mentions related recent changes: "Entra-protected MCP servers can silently renew access-token-only credentials" and "Entra sign-in falls back to browser auth when no broker is available" — but in this case it is not falling back to browser auth; it hard-fails instead.
Activity
JoshEbersol commentedon Oct 7, 2026
Same issue here on 1.0.92 (Windows, Entra broker). With debug logging, the logs show where the error comes from and suggest a workaround.
Where the error comes from: the CLI's own Rust MCP OAuth layer, not
msalruntime.dll:Regression: On 1.0.91 the same config and machine logged
Entra scope binding validation bypassed for an unbound scopeand auth succeeded. On 1.0.92 the default is strict, and the rejection is fatal with no browser fallback.Looks like a bug in the binding check itself:
https://mcp.dev.azure.com/.defaultis on the same origin as the server URLhttps://mcp.dev.azure.com/<org>, so it should count as bound. The check appears to compare against the path-qualified URL, not the origin. Servers that advertiseapi://<app-id>/...scopes fail the same way.Workaround: set this user env var and start a new terminal:
Note that this relaxes the scope-binding protection for all MCP servers, not just ADO - so it should be removed once there's a fix.
davidgourde commentedon Oct 7, 2026
I’m seeing the same error in GitHub Copilot Desktop on Windows, not just standalone CLI. The CLI runtime in my app session is 1.0.93-1.
In Customize, clicking Sign in for the hosted Azure DevOps MCP server (
ado-remote-mcp, endpointhttps://mcp.dev.azure.com/<org>) fails with:Over the last couple of days, I’ve also seen multiple MCP servers repeatedly lose authentication or refresh/reconnect, enough to interrupt my work. I don’t yet know whether that recurring behavior is related to this specific sign-in failure.
I have not applied the
allow_unbound_scopesworkaround because it relaxes scope validation beyond this one server. Please include the Desktop authentication path when investigating this issue, and provide a supported workaround that preserves scope validation.bcxpsebastian commentedon Oct 12, 2026
It seems to work again in 1.0.95 (and possibly 1.0.94). I disabled the workaround.