github / github/copilot-cli

Copilot CLI 1.0.79-1 fails MCP initialization when `server/discover` returns `-32602`

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

还没有人认领这个 Issue。

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

描述

Describe the bug

Copilot CLI 1.0.79-1 cannot connect to an MCP server built with FastMCP.

Before MCP initialization completes, the CLI sends a server/discover request. FastMCP does not implement this method and returns -32602 Invalid request parameters. Copilot treats that response as a fatal lifecycle negotiation error and aborts initialization.

The same server and configuration work without issue in Copilot CLI 1.0.78.

Affected version

1.0.79-1

Steps to reproduce the behavior
  1. Configure the MCP server as shown in "Additional Context".
  2. Start Copilot CLI 1.0.79-1.
  3. Observe the CLI sending server/discover.
  4. FastMCP rejects the unsupported request.
  5. Copilot aborts MCP lifecycle negotiation before initialize completes.
Expected behavior

An unsupported optional server/discover request should not block normal MCP initialization.

If the server returns an error for the probe, Copilot should continue with the standard initialize lifecycle rather than treating the response as fatal.

In particular, this should not depend on the server returning exactly -32601 Method not found. FastMCP currently returns -32602 because the request does not match any supported ClientRequest schema.

Additional context

MCP configuration

Values have been redacted:

{
  "mcpServers": {
    "fabric-rti-mcp": {
      "command": "uvx",
      "args": ["microsoft-fabric-rti-mcp"],
      "env": {
        "KUSTO_SERVICE_URI": "<redacted>",
        "KUSTO_SERVICE_DEFAULT_DB": "<redacted>",
        "FABRIC_API_BASE": "<redacted>"
      }
    }
  }
}

More Details

Another MCP implementation returns:

Method 'server/discover' is not available.

Copilot tolerates that response and continues initialization.

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先跟踪发送 server/discover 请求的 MCP 初始化流程,然后将对 -32602 响应的处理与此处描述的可容忍的“Method not found”响应进行比较。当不支持的探测不再中止初始化,并且 FastMCP 配置能够完成标准的 initialize 生命周期时,即视为完成。

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

评估

技术栈
shell
领域
cli
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
65/100

把新 issue 发到你的邮箱

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