mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-07-09 17:28:42 +00:00
fix(mcp): route tracing output to stderr to prevent JSON-RPC stdio corruption (#470)
The ruvector-mcp binary initializes its tracing subscriber without specifying a writer, defaulting to stdout. Under the stdio MCP transport this contaminates the JSON-RPC frame stream with log lines, causing every @modelcontextprotocol/sdk client to throw a Zod parse error on the very first frame. Add .with_writer(std::io::stderr) to both the debug and release tracing subscriber builders in crates/ruvector-cli/src/mcp_server.rs. Verified by stdio smoke test: first line of stdout is now a valid JSON-RPC initialize response with serverInfo.name == "ruvector-mcp", and tracing output appears exclusively on stderr as required by the MCP stdio transport spec.
This commit is contained in:
parent
ca62a44c2c
commit
38105cf89b
1 changed files with 2 additions and 0 deletions
|
|
@ -48,10 +48,12 @@ async fn main() -> Result<()> {
|
|||
// Initialize logging
|
||||
if cli.debug {
|
||||
tracing_subscriber::fmt()
|
||||
.with_writer(std::io::stderr)
|
||||
.with_env_filter("ruvector=debug")
|
||||
.init();
|
||||
} else {
|
||||
tracing_subscriber::fmt()
|
||||
.with_writer(std::io::stderr)
|
||||
.with_env_filter("ruvector=info")
|
||||
.init();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue