McpServer.tryServeStdioListen

If msg is a draft subscriptions/listen request, serve it on the stdio transport's single channel and return true; otherwise return false (the caller dispatches it normally). On the stdio transport every message shares one stdout channel, so — unlike Streamable HTTP — there is no separate SSE stream to open. Per the draft, a subscriptions/listen reply is NOT a { acknowledged: true } JSON-RPC result (the schema defines no such Result); the acknowledgement is a notifications/subscriptions/acknowledged notification that MUST be the first message on the stream. This records the opted-in change-notification filters, installs writeLine as the delivery sink (so subsequent notify*/notifyResourceUpdated are written to stdout, each stamped with the listen id as io.modelcontextprotocol/subscriptionId), and writes the stamped acknowledgement as that leading message. Pre-draft versions never defined subscriptions/listen, so they take the normal path (returns false) and the request is answered conventionally.

class McpServer
@safe
bool
tryServeStdioListen
(,
void delegate
(
string
)
@safe
writeLine
)