[BUG] M365 MCP OAuth fails with AADSTS9000411 - parameter 'prompt' is duplicated

Resolved 💬 18 comments Opened Mar 5, 2026 by stefanlindqvist Closed Apr 24, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When authenticating the Microsoft 365 MCP connector via /mcp in Claude Code,
the OAuth redirect to Microsoft Entra ID fails with:

AADSTS9000411: The request is not properly formatted.
The parameter 'prompt' is duplicated.

This suggests the OAuth authorization URL being constructed by Claude Code
sends the prompt parameter twice.

What Should Happen?

The authentication via browser should trigger an account selection dialog for authentication.

Error Messages/Logs

- Request Id: 5fbd47a4-6cc2-4ce2-8255-1632a4264700
- Correlation Id: 67e883f1-c921-4728-aeec-c70b6df03547
- Timestamp: 2026-03-05T13:44:50Z

Steps to Reproduce

  1. Have Microsoft 365 MCP server configured in settings.json
  2. Run claude and enter /mcp
  3. Select Microsoft 365 and authenticate
  4. Browser opens to Microsoft sign-in and immediately shows the error

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.58 (native)

Platform

Other

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

<img width="649" height="640" alt="Image" src="https://github.com/user-attachments/assets/27663134-7208-4f9d-9867-3f22c0d5ce2b" />

View original on GitHub ↗

18 Comments

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/21309
  2. https://github.com/anthropics/claude-code/issues/23560
  3. https://github.com/anthropics/claude-code/issues/23593

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

RealfinityKipper · 4 months ago

having this same issue, additionally once I remove the duplicate prompt parameter manually and retry it gives a callback error
AADSTS50011: The redirect URI 'http://localhost:52024/callback' specified in the request does not match the redirect URIs configured for the application '08ad6f98-a4f8-4635-bb8d-f1a3044760f0'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.

dimisant · 4 months ago

Still hitting this issue on v2.1.76

mikaelfun · 4 months ago

still having issue

mh-dh · 3 months ago

Same Issue here per Microsoft 365 Connector in Claude.ai

mcplunk-code · 3 months ago

Hitting this same issue on Mac, Claude Code v2.1.84, Autodesk Microsoft tenant.

apstanto · 3 months ago

Same issue on 2.1.86. Any workaround available?

dnzhng17 · 3 months ago

Continues to be an issue on 2.1.87.

Nolander75 · 3 months ago

The Microsoft 365 MCP server (mcp__m365__* tools) fails to authenticate via OAuth. The Azure AD login page returns:

> AADSTS9000411: The request is not properly formatted. The parameter 'prompt' is duplicated.

## Steps to Reproduce

  1. Open Claude Code with the Microsoft 365 MCP server configured
  2. Run /mcp and attempt to authenticate the Microsoft365 MCP
  3. OAuth flow fails with AADSTS9000411

## Expected Behavior
OAuth flow completes successfully and M365 tools become available.

## Actual Behavior
Azure AD rejects the auth request because the prompt parameter is sent twice in the OAuth URL, which is a malformed request per OAuth 2.0 spec.

## Environment

  • OS: Windows 11 Enterprise 10.0.26100
  • Claude Code version: (check with claude --version)
  • Tenant: T-Mobile USA (Azure AD tenant)

## Root Cause (suspected)
The MCP server's OAuth flow is appending prompt=... twice to the authorization URL. Azure AD enforces strict parameter deduplication and rejects the
request.

## Workaround
Using Azure CLI + Microsoft Graph API directly works fine:
az account get-access-token --resource "https://graph.microsoft.com"

rpeaston · 3 months ago

I have this same issue on version 2.1.97.

apstanto · 3 months ago

Confirmed — bypassing the MCP proxy and calling Microsoft Graph API directly works. Registered my own Azure AD app with device code flow and have had full email and Teams access restored for 2 days.

shayandes-stack · 3 months ago

Im trying to connect Microsoft 365 to Claude AI and getting the same error. Any workarounds?

ssopotov-cai · 2 months ago

Reproduced on Windows 11 with Claude Code 2.1.58 (native), VS Code integrated terminal. Same AADSTS9000411 with the exact URL shape (prompt=select_account ... prompt=consent).

(Originally filed separately as #52444 before finding this issue.)

dimisant · 2 months ago

Still not working for me even though th bug is closed.

mh-dh · 2 months ago
Still not working for me even though th bug is closed.

Are you sure that your Entra Tenant has no Conditional Access Policies blocking this ?

dimisant · 2 months ago
> Still not working for me even though th bug is closed. Are you sure that your Entra Tenant has no Conditional Access Policies blocking this ?

Thanks for the reply. I'm not sure, I'm just a non-technical guy playing with claude code. I just assumed that if something else was blocking it then I would get a different error from last time. That would make sense, right? I will nevertheless try to troubleshoot it with CC

mh-dh · 2 months ago
> > Still not working for me even though th bug is closed. > > > Are you sure that your Entra Tenant has no Conditional Access Policies blocking this ? Thanks for the reply. I'm not sure, I'm just a non-technical guy playing with claude code. I just assumed that if something else was blocking it then I would get a different error from last time. That would make sense, right? I will nevertheless try to troubleshoot it with CC

Its Common for enterprises with Microsoft / Entra Tenant to have Conditional Access policies whci enforce MFA or block access from certain countries or only allow company Owned Devices etc. and the Anthropic Servers may be blocked by those Policies. This would cause this issue. Thing is: we get the Error from this thread here and not the "correct" error that a policy blocked it.

github-actions[bot] · 2 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.