Support dual-era servers (legacy + 2026-07-28 on the same endpoint)

未關閉
#1,203 1 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
25/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
java

研究方向

Start by reading the linked protocol versioning section and inspect the server entry points for McpServer, McpAsyncServer, and McpSyncServer. Work out how Streamable HTTP and stdio select a protocol era, including how initialize errors report supported versions. Done means one composed server can serve both eras while the existing server classes remain single-era.

由索引模型根據 Issue 內容生成。

描述

area/server enhancement P2
Context

The 2026-07-28 revision defines a dual-era implementation as one that supports both modern (stateless, per-request _meta) and legacy (initialize handshake, 2025-11-25 and earlier) protocol versions. See Versioning: Backward Compatibility.

Requirements

Let users run one server that serves both eras, picking the era from how the client opens, as the spec describes:

  • A request carrying modern per-request _meta is served statelessly under 2026-07-28.
  • An initialize request selects legacy semantics, scoped to the session (HTTP) or the process (stdio).

Existing server (McpServer, McpAsyncServer and McpSyncServer) must remain single-era, the multi-era composition happens at a higher level.

Notes

At minimum this covers Streamable HTTP (one endpoint, both eras at the same time) and stdio (the era is fixed by the first message). The spec also asks dual-era servers to list their supported protocol versions in any error returned to initialize.

Ideally users register tools, resources and prompts once and the SDK serves them under either era, so they don't maintain two server definitions. This might not be 100% possible, some edge cases are acceptable.

主要語言
Java
星號
3.8k
分支
1.1k
平均合併
1 天 3 小時
30 天內合併 PR
38

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

modelcontextprotocol/java-sdk 的其他 Issue

查看 modelcontextprotocol/java-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。