MCP OAuth intermittently fails on Windows with socket error 10013
Personne n'a encore pris cette issue.
- Langage dominant
- Shell
- Étoiles
- 11.2k
- Forks
- 1.9k
- Merge moyen
- 14 h 16 min
- PR mergées (30 j)
- 6
Description
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
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par le flux /mcp auth et la gestion de auth.redirectPort qui crée le listener local du callback OAuth ; reproduisez l’échec sous Windows avec un serveur MCP HTTP distant prenant en charge OAuth, sans remplacement de port. Le travail est terminé lorsque la sélection automatique du port réessaie après un échec de bind et signale le port tenté si toutes les nouvelles tentatives échouent.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Domaine
- authentication, cli, networking
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 67/100