OAuth: Duplicate prompt=consent parameter in Microsoft 365 MCP authorization URL
Description
When authenticating with the Microsoft 365 MCP server (https://microsoft365.mcp.claude.com/mcp), Claude Code generates a malformed OAuth authorization URL that contains the prompt parameter twice with different values. This causes authentication to fail.
Steps to Reproduce
- Add the Microsoft 365 MCP server:
``bash``
claude mcp add --transport http microsoft365 https://microsoft365.mcp.claude.com/mcp
- Run
/mcpin Claude Code
- Select the Microsoft 365 server and choose to authenticate
- Observe the authorization URL that is generated - it contains
promptparameter twice with different values
Expected Behavior
The OAuth authorization URL should contain prompt only once with a single value:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?prompt=select_account&...
Actual Behavior
The URL contains the prompt parameter twice with different values - once at the beginning and once at the end:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?prompt=select_account&{other_parameters}&prompt=consent
This malformed URL with conflicting prompt values causes the Microsoft OAuth flow to fail.
Analysis
The duplicate parameter is present in the URL before clicking/opening it, indicating the issue is in Claude Code's OAuth URL construction logic. It appears:
- The MCP server (or Microsoft's OAuth metadata) specifies
prompt=select_account - Claude Code's OAuth handler appends
prompt=consentseparately - Both end up in the final URL, creating an invalid request
The OAuth handler should either:
- Use only the server-specified prompt value, OR
- Override/replace (not append) if Claude Code needs to enforce
prompt=consent
Environment
- Claude Code version: 2.1.22
- OS: Windows
- MCP Server URL:
https://microsoft365.mcp.claude.com/mcp
Workaround
None found - authentication cannot complete with conflicting prompt parameters.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗