McpServer.serverPushChannel

The server->client push channel for *unsolicited* traffic — the messages a server sends on the standalone SSE stream a client opens with an HTTP GET to the MCP endpoint (basic/transports §Listening for Messages from the Server), outside any in-flight POST. The Streamable HTTP transport creates it (sharing the supplied StreamCoordinator) when the mount is set up; it is created lazily on first access so callers can hold a reference before mounting. Use notify (or the returned channel's emit) to deliver notifications/requests to every connected GET listener.

  1. ServerPushChannel serverPushChannel(StreamCoordinator coord)
    class McpServer
    @safe
    serverPushChannel
  2. ServerPushChannel serverPushChannel()