5d4a98d06e
Reserve stdout for the JSON-RPC stream: _configure_stderr_logging() pins all logging to stderr (and rewrites any stray stdout handler) so a log line can never corrupt the stdio protocol. Extract a pure, testable build_server() from _serve(). Add end-to-end tests over the mcp in-memory transport (initialize + tools/list + tools/call), covering a successful round trip and a policy denial surfaced as an MCP error.