McpServer.pingClient

Initiate a server->client ping on the standalone GET SSE push channel and block until a connected client acknowledges with the spec-mandated empty result (basic/utilities/ping: "Either the client or server can initiate a ping by sending a ping request"). This is the server-side counterpart to McpClient.ping(), exposing the SHOULD-periodic connection-health probe the spec describes for either party. The probe rides the same push channel notify uses, and the client's reply is correlated via the shared StreamCoordinator when it POSTs the response.

Throws internalError when the server is not mounted on a Streamable HTTP transport (no push channel) or no client is listening on a GET stream, or on a client error / timeout (treat a timeout as a stale connection per the spec). The request carries no params, exactly as the spec requires.

  1. void pingClient(Duration timeout)
    class McpServer
    @safe
    void
    pingClient
    (
    Duration timeout = 60.seconds
    )
  2. void pingClient(string sessionId, Duration timeout)