github / github/copilot-cli

MCP OAuth intermittently fails on Windows with socket error 10013

Offen
#4,463 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

area:authentication area:mcp area:platform-windows
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

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
  1. Configure an OAuth-enabled remote HTTP MCP server without specifying auth.redirectPort.
  2. Start a new Copilot CLI session.
  3. Run /mcp auth <server-name>.
  4. 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem /mcp auth-Ablauf und der Behandlung von auth.redirectPort, die den lokalen OAuth-Callback-Listener erstellt; reproduziere den Fehler unter Windows mit einem OAuth-fähigen entfernten HTTP-MCP-Server ohne Port-Override. Als erledigt gilt die Aufgabe, wenn die automatische Portauswahl nach einem Bind-Fehler erneut versucht wird und den versuchten Port meldet, falls alle Wiederholungsversuche fehlschlagen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Bereich
authentication, cli, networking
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
67/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.