[BUG] MCP Connector OAuth popup window doesn't close after successful Entra ID authentication
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 connecting a new MCP server that uses Entra ID (Azure AD) as the OAuth authorization server, the authentication popup window remains open and appears to still be processing after the user has successfully authenticated and the connector has been added to Claude.
Environment:
Claude.ai (web client)
MCP Server using Streamable HTTP transport
OAuth flow delegated to Entra ID via RFC 9728 / RFC 8414 metadata discovery
Auth architecture:
The MCP server acts as a resource server only (not an authorization server). It serves OAuth discovery metadata via mcpAuthMetadataRouter from @modelcontextprotocol/sdk, with authorization_endpoint and token_endpoint pointing directly to Entra ID's v2.0 endpoints. The MCP server does not handle any part of the authorization code exchange — Claude.ai interacts with Entra directly.
What Should Happen?
The popup window should close automatically (or display a "You can close this window" message) once the connector is successfully added.
Actual behavior:
The popup window remains open and appears to be loading/processing indefinitely. The connector is added successfully in the main Claude.ai window — the popup just doesn't close. This is confusing for users who may think authentication is still in progress or has failed.
Error Messages/Logs
Steps to Reproduce
- Configure an MCP server that serves RFC 9728 protected resource metadata and RFC 8414 authorization server metadata, with both authorization and token endpoints pointing to an external IdP (Entra ID)
- In Claude.ai, add a new MCP connector pointing to the server's APIM endpoint
- Claude.ai opens a popup window to Entra's /authorize endpoint
- User completes authentication (credentials + MFA if applicable)
- Entra redirects back to Claude.ai's callback with the authorization code
- Claude.ai successfully exchanges the code and adds the connector
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude Code 2.1.47
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗