Describe the bug
OAuth authentication for a remote HTTP MCP server intermittently fails before the browser authorization flow opens.
OAuth authentication failed: MCPOAuthError: An attempt was made to
access a socket in a way forbidden by its access permissions. (os error 10013)
Affected version
1.0.79
Steps to reproduce the behavior
- Configure an OAuth-enabled remote HTTP MCP server without specifying
auth.redirectPort.
- Start a new Copilot CLI session.
- Run
/mcp auth <server-name>.
- Authentication may fail while creating the local OAuth callback listener.
Expected behavior
Copilot CLI should select an available callback port. If binding fails, it should retry using another port and report the attempted port if all retries fail.
Additional context
Workaround
Pinning a known-available port and restarting Copilot CLI allowed authentication to complete:
"auth": {
"redirectPort": 47000
}
The problem is intermittent. Authentication later worked without the override, possibly because credentials were cached or automatic port selection chose a usable port.
Environment
- Copilot CLI: 1.0.79
- Package: 1.0.79-9
- OS: Windows x64
Describe the bug
OAuth authentication for a remote HTTP MCP server intermittently fails before the browser authorization flow opens.
Affected version
1.0.79
Steps to reproduce the behavior
auth.redirectPort./mcp auth <server-name>.Expected behavior
Copilot CLI should select an available callback port. If binding fails, it should retry using another port and report the attempted port if all retries fail.
Additional context
Workaround
Pinning a known-available port and restarting Copilot CLI allowed authentication to complete:
The problem is intermittent. Authentication later worked without the override, possibly because credentials were cached or automatic port selection chose a usable port.
Environment