MCP OAuth intermittently fails on Windows with socket error 10013
Nessuno ha ancora preso questa issue.
- Lingua principale
- Shell
- Stelle
- 11.2k
- Fork
- 1.9k
- Merge medio
- 14h 16m
- PR unite (30g)
- 6
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con il flusso /mcp auth e la gestione di auth.redirectPort che crea il listener locale del callback OAuth; riproduci il fallimento su Windows usando un server MCP HTTP remoto con OAuth abilitato e senza override della porta. Il lavoro è completato quando la selezione automatica della porta ritenta dopo un errore di bind e segnala la porta tentata se tutti i tentativi successivi falliscono.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Ambito
- authentication, cli, networking
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 67/100