MCP OAuth intermittently fails on Windows with socket error 10013
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với flow /mcp auth và phần xử lý auth.redirectPort tạo listener callback OAuth cục bộ; tái hiện lỗi trên Windows bằng cách sử dụng máy chủ MCP HTTP từ xa có bật OAuth mà không override cổng. Hoàn thành khi việc tự động chọn cổng thử lại sau lỗi bind và báo cáo cổng đã thử nếu tất cả các lần thử lại đều thất bại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Lĩnh vực
- authentication, cli, networking
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 67/100