/mcp search fails with 400 Bad Request in every repo with a non-GitHub (Azure DevOps) git remote
まだ誰も着手していません。
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
説明
Describe the bug
/mcp search (interactive MCP registry browser) consistently fails with:
Failed to load registry: Error: Failed to fetch MCP registry policy: 400 Bad Request
whenever Copilot CLI is started inside a trusted folder whose git remote points to Azure DevOps (dev.azure.com) instead of a GitHub-hosted remote. This affects our entire engineering org, since 100% of our repositories are hosted on Azure DevOps.
Environment
- Enterprise: GitHub Enterprise Cloud with data residency / EMU tenant
- OS: Windows
- Enterprise MCP Registry: configured and verified working (Azure API Center-backed registry, "Registry only" policy) — confirmed via direct
curlcalls that the registry itself returns HTTP 200 with the expected servers.
Workaround: Run /mcp search from a non-git folder to add servers once; they then work from any repo afterward via the persisted ~/.copilot/mcp-config.json.
Affected version
GitHub Copilot CLI 1.0.78
Steps to reproduce the behavior
- Configure an enterprise MCP Registry URL + "Registry only" policy (per GitHub docs).
cdinto any local git repository whoseoriginremote is an Azure DevOps URL (e.g.https://org@dev.azure.com/org/project/_git/repo).- Start
copilot. - Run
/mcp search. - Observe:
Failed to load registry: Error: Failed to fetch MCP registry policy: 400 Bad Request. cdoutside any git repository (e.g. home directory) and start a freshcopilotprocess.- Run
/mcp searchagain → succeeds, returns all registry servers.
Expected behavior
/mcp search should successfully fetch the registry policy regardless of the git remote host of the current working directory, or at minimum should not derive repo/org context from non-GitHub git remotes in a way that breaks the request.
Additional context
- The failure is tied to process startup cwd/git-remote context, not conversation state:
/newinside the same running process does not recover it — only a full process relaunch outside a git-remote folder works. - Once servers are added via the workaround below (outside a repo), they persist in
~/.copilot/mcp-config.jsonand connect fine from inside our Azure DevOps repos afterward — so the registry policy fetch specifically is what's broken, not general MCP connectivity. - Reproduces consistently; not a timing/cache issue; not related to our enterprise's registry configuration (independently verified correct).
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、Azure DevOps の remote を持つリポジトリと、git フォルダーではないフォルダーで /mcp search を再現し、その後、MCP レジストリポリシーの取得に使用される起動コンテキストを追跡します。現在の git remote に関係なくレジストリ検索が成功し、~/.copilot/mcp-config.json にある既存の永続化された設定を壊さなければ、issue は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- github, shell
- 領域
- api, cli
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 55/100