stdio_loggingTier 1 · 70% confidence

mcp-stdio-logging-mcp-server-logs-to-stdout-e-g-using-console-log-or-05987319

agent: mcp

When does this happen?

IF MCP server logs to stdout (e.g., using console.log or print()) on a STDIO transport, corrupting JSON-RPC messages and breaking communication.

How others solved it

THEN For STDIO-based MCP servers, redirect logging to stderr: in Python, use print(..., file=sys.stderr) or a logging library that writes to stderr; in TypeScript, use console.error(). This prevents corruption of the JSON-RPC message stream.

In Python: print('Processing request', file=sys.stderr)
In TypeScript: console.error('Server started');

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics