MCP OAuth intermittently fails on Windows with socket error 10013
まだ誰も着手していません。
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
/mcp auth フローと、ローカルの OAuth コールバックリスナーを作成する auth.redirectPort の処理から始め、ポートの上書きなしで OAuth 対応のリモート HTTP MCP サーバーを使用して Windows 上で失敗を再現します。すべての再試行が失敗した場合に、自動ポート選択が bind 失敗後に再試行し、試行したポートを報告すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 領域
- authentication, cli, networking
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 67/100