github / github/copilot-cli

Workspace .mcp.json is never loaded in CLI 1.0.83 — 'mcp list' shows no Workspace group

未关闭
#4,832 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

triage
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

Describe the bug

Copilot CLI 1.0.83 does not load workspace MCP config at all. A repo-root .mcp.json is ignored, and copilot mcp list never emits a Workspace group — only User servers:.

This is not a display-only problem: the servers are never started. The session log contains no spawn attempt for the workspace servers.

copilot mcp --help explicitly advertises the source:

Configuration is loaded from multiple sources:
  User       ~/.copilot/mcp-config.json
  Workspace  .mcp.json or .github/mcp.json
  Plugin     Installed plugins with MCP servers

Affected version

GitHub Copilot CLI 1.0.83.

macOS (Apple Silicon).

Steps to reproduce

In a pristine git repo, with no .vscode/ directory and no comments in the JSON:

mkdir repro && cd repro && git init -q .
cat > .mcp.json <<'JSON'
{
  "mcpServers": {
    "repro_probe": { "type": "local", "command": "node", "args": ["server.js"] }
  }
}
JSON
copilot mcp list
copilot mcp get repro_probe

Actual behavior

$ copilot mcp list
User servers:
  linear (http)
  figma (http)

$ copilot mcp get repro_probe
Error: Server "repro_probe" not found.

copilot mcp list --json likewise contains only "source": "user" entries — no workspace entries at all.

Expected behavior

repro_probe appears under a Workspace group and is started for the session.

Ruled out

Each of these was tested individually, not assumed:

Hypothesis Result
Folder not trusted Repo has an entry in ~/.copilot/permissions-config.json with write approvals
Version too old 1.0.83; support shipped in v0.0.401 per #1291
Enterprise/managed policy Logs show managedSettings ... source=none, bypassDisabled=false
"type": "stdio" vs "local" Both ignored
mcpServers vs servers key Both ignored
.github/mcp.json path Also ignored
Comments in JSON (#4323) File is strict JSON, no comments; repro has no .vscode/mcp.json either
Not at repo root (#4765) cwd is the repo root
Servers themselves broken All start and authenticate fine when launched by hand, and work once copied into ~/.copilot/mcp-config.json

Possibly related

  • #3126 — same end symptom (includeWorkspaceSources never set), but reported via the SDK's enableConfigDiscovery path. This report is the plain interactive CLI, so the two may share a root cause.
  • #4542 — there mcp list does detect the workspace file and only the session connection fails; here it is never detected.
  • #4636 — startup reconciliation dropping servers in 1.0.81-11, but for --additional-mcp-config.

Impact / workaround

Workspace .mcp.json is the only version-controlled way to share MCP servers with a team. The workaround is to duplicate every server into ~/.copilot/mcp-config.json using absolute paths, which is per-machine and not version-controlled, so each person repeats the setup and the lists drift.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先使用仓库根目录中的 .mcp.json 重现该问题,并将交互式 CLI 的工作区发现与用户配置路径进行比较。跟踪 Workspace 源为何未出现在 copilot mcp list 中,并确认修正后的配置既会列出服务器,也会为会话启动服务器。

由索引模型根据 Issue 内容生成。

评估

领域
cli
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
描述清楚
新手友好度
55/100

把新 issue 发到你的邮箱

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