A team is building a brand-new stdio server for revision 2026-07-28 and wants its debug output to reach developers. Which approach does the specification recommend?
Select an answer to reveal the explanation.
Short Explanation
On stdio, stdout is a one-lane road reserved for MCP traffic, so your chatter goes to stderr. MCP's own Logging feature is deprecated, and you shouldn't build new code on it. If you want rich telemetry, OpenTelemetry is the recommended route.
Full Explanation
Revision 2026-07-28 deprecates the Logging feature. New implementations should not adopt it, and existing ones should migrate to logging to stderr for stdio transports, or to OpenTelemetry for structured observability. The stdio transport already reserves stdout for valid MCP messages and allows the server to write UTF-8 log text to stderr, which clients may capture, forward or ignore and should not treat as an error by itself. Calling logging/setLevel fails because that method was removed in this revision; a legacy log level is now carried per request in _meta as io.modelcontextprotocol/logLevel, and it is set by the client, not by the server at startup. Emitting notifications/message on every response fails because servers must not emit those notifications for requests that did not include the logLevel field, and the feature is deprecated in any case. Printing to stdout fails by concept: anything on stdout that is not a valid MCP message corrupts the stream the client parses. Exam caveat: deprecated logging still functions for existing servers during the transition window, but it is not the design to choose for new work. Operational check: run the server under a client, generate debug output, and confirm it appears only on stderr while stdout carries nothing but newline-delimited JSON-RPC.