github / github/copilot-cli

Do not initiate redundant MCP OAuth Flows per server

未关闭
#2,036 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
msft-dogfood
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the feature or problem you'd like to solve

When using multiple mcp servers which use the same client id, the user should be only prompted for auth once

### Proposed solution

**Proposed solution:**
Token deduplication: Before initiating a new OAuth flow, check if an existing valid token in the cache satisfies the requested (audience, scopes) — if so, reuse it. This would reduce N browser prompts to 1.

Verifier cleanup: On startup, remove any .verifier files whose corresponding token is absent or expired, rather than treating them as in-progress flows.

User feedback: If an OAuth flow does time out, surface a clear error message indicating which server failed and provide the remediation command.

**How will it benefit?**
Github copilot CLI users will experience less auth prompts when multiple mcp servers with the same clientId are configured.

Please refer to: https://github.com/microsoft/work-iq/issues/66

### Example prompts or workflows

1. Add 10 mcp servers to the mcp.json which use the same clientId.
2. Start GH Copilot CLI
3. The user will see 10 browser tabs popping up and will have to complete the auth flow for 10 tabs

### Additional context

More details are captured in this issue:
https://github.com/microsoft/work-iq/issues/66

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。