Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

MCP client sends legacy initialize after successful 2026-07-28 server/discover

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

还没有人认领这个 Issue。

评估

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

调研方向

Start with the MCP stdio connection flow described in the issue, tracing the successful server/discover response and the subsequent initialize request. Reproduce the wire sequence against a dual-era server; done means Copilot adopts 2026-07-28 without sending initialize, or closes the connection before opening a fresh one for the legacy handshake.

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

描述

triage

Summary

Copilot CLI sends a successful MCP 2026-07-28 discovery request and then sends a legacy 2025-11-25 initialize request on the same stdio connection. A dual-era MCP SDK server correctly locks the connection to the modern protocol after server/discover, so it rejects the subsequent handshake with -32022.

This prevents Basic Memory from connecting even though the server successfully answers Copilot's discovery request.

Versions

  • Copilot CLI stable: 1.0.85
  • Also reproduced with prerelease: 1.0.86-2
  • Basic Memory: 0.23.2
  • FastMCP: 4.0.3 and 4.0.4
  • Python MCP SDK: 2.2.0
  • macOS arm64
  • Transport: stdio

Wire sequence

Client sends:

{"jsonrpc":"2.0","id":0,"method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"copilot-cli","version":"1.0.85"},"io.modelcontextprotocol/clientCapabilities":{"sampling":{},"elicitation":{"form":{},"url":{}}}}}}

Server successfully responds:

{"jsonrpc":"2.0","id":0,"result":{"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"Basic Memory","version":"4.0.3"}},"supportedVersions":["2026-07-28"],"capabilities":{"logging":{},"prompts":{"listChanged":false},"resources":{"subscribe":false,"listChanged":false},"tools":{"listChanged":false},"extensions":{"io.modelcontextprotocol/ui":{}}},"resultType":"complete"}}

Copilot then sends on the same connection:

{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{"sampling":{},"elicitation":{"form":{},"url":{}}},"clientInfo":{"name":"copilot-cli","version":"1.0.85"}}}

The server correctly rejects that mixed-era request:

{"jsonrpc":"2.0","id":1,"error":{"code":-32022,"message":"connection is serving the 2026-07-28 protocol; the initialize handshake is not accepted","data":{"supported":["2026-07-28"],"requested":"2025-11-25"}}}

Copilot logs the server as failed to initialize.

Expected behavior

After a successful server/discover, Copilot should adopt the returned modern protocol and must not send initialize on that connection. If Copilot decides discovery failed or is unusable, it should close that connection and open a fresh connection before attempting the legacy handshake.

Additional verification

  • A fresh MCP 1.x client successfully negotiates 2025-11-25 with the same Basic Memory server.
  • Forcing the server into handshake-only mode makes Copilot connect and call Basic Memory tools successfully.
  • Disabling Basic Memory's initialization sync does not fix the issue; server/discover still succeeds and Copilot still sends initialize afterward.
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

贡献指南

打开贡献指南

从这里开始

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

github/copilot-cli 的其他 Issue

查看 github/copilot-cli 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

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