PRODUCTION SCENARIO
You wrap an internal ticketing API as a stdio Model Context Protocol (MCP) server. After adding print statements that write 'connecting...' and request timings to standard output, the client reports parse errors and the server's tools vanish from the tool list.
What should the server do with its diagnostic logging?
Answering here is anonymous. Nothing is saved unless you sign in.
Show answer and explanation
Answer: Write the log lines to stderr only, leaving stdout for newline-delimited JSON-RPC messages
On the stdio transport stdout carries only valid MCP messages delimited by newlines, so anything else corrupts the stream and breaks the client's parser. A server may write UTF-8 log strings to stderr, which the client is free to capture, forward, or ignore.