fix: redirect tracing logs to stderr to keep stdout clean for MCP JSON

tracing_subscriber::fmt::init() defaults to stdout, contaminating the
MCP JSON-RPC stream and causing Claude Code and Windsurf to fail the
initialize handshake with "failed to reconnect".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Devid HW
2026-04-19 09:21:00 +07:00
parent b63bda64ab
commit fdb45b8eed
+3 -1
View File
@@ -78,7 +78,9 @@ pub struct ToolCapabilities {
#[tokio::main]
async fn main() -> Result<()> {
tracing_subscriber::fmt::init();
tracing_subscriber::fmt()
.with_writer(std::io::stderr)
.init();
let cli = Cli::parse();