McpServer.layerHttp: optional legacy GET SSE for idle list-change notifications

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

维护者通常 1 天内回复

@effect-bot 已经在做这个了。

开始于 2026年11月7日。

评估

这个 Issue 还没有评估数据。

描述

Feature request

Please consider an opt-in standalone GET SSE stream for sessionful MCP protocol revisions on McpServer.layerHttp, so an idle connected client can receive notifications/tools/list_changed (and the other list-change notifications).

This is a request for a currently documented limitation, not a claim that returning 405 violates the protocol: the GET event stream is optional. Effect 4.1.2 explicitly excludes GET SSE in the layerHttp documentation.

Reproduction and observed behavior

Environment: [email protected], @effect/[email protected], Node 26.12.1, and the independent @modelcontextprotocol/[email protected] client.

  1. Run a long-lived McpServer.layerHttp endpoint with protocols: [McpProtocol.v2025_11_25] and a registered toolkit.
  2. Connect the SDK Client with StreamableHTTPClientTransport, and register a ToolListChangedNotificationSchema handler.
  3. Initialization, listing and tool calls succeed; the client retains its negotiated session id.
  4. The SDK opens an idle GET stream on the same endpoint. The endpoint returns 405.
  5. Update the registered tool description while the client is idle. A subsequent listTools sees the new description, but the notification handler receives no tools/list_changed (a separate 5-second wait expires).
  6. The same dynamic catalog and SDK client over layerStdio / StdioClientTransport receive the notification without reconnecting.

The downstream proof exercises real HTTP calls and real stdio in a child process, including a live implementation transition. We keep the notification assertion on stdio and document the HTTP limitation rather than implement an alternate transport in the application.

Desired behavior

With an explicit option enabling legacy GET SSE, retain the stream under the MCP session owner and deliver server-initiated notifications independently of an active POST. Scope closure, session termination and client disconnect should close it. This need not include replay, event resumption or session expiry.

An application can change a tool's description or side-effect hints after replacing its implementation. Existing clients need to learn about that change before their next call; polling listTools on every call is not equivalent to the notification mechanism.

This differs from #8060, which covered notifications emitted during an active request, and #8919, which covered optional subscriptions for the 2026 protocol. Stdio and the newer subscription transport remain usable alternatives.

主要语言
TypeScript
星标
16.7k
派生
808
平均合并
14 小时 46 分钟
30 天内合并 PR
798

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

Effect-TS/effect 的其他 Issue

查看 Effect-TS/effect 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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