Leading garbage before JSON
bom-garbage · Transport & framing
Endpoint (Streamable HTTP)
https://chaos-mcp.thomascdnns.com/s/bom-garbage/mcp
On the wire — recorded from a real request
Symptom
what you'll observeSome parsers fail; others silently skip the first tool. Intermittent and confusing.
Cause
what this reproducesA stray log/print writes to stdout (the stdio transport) or before the HTTP body — debug output leaks into the stream.
Fix
how you'd resolve itNever write to the transport stream except protocol messages; route logs to stderr/files.
Try it with curl
bash
curl -sS -X POST \
https://chaos-mcp.thomascdnns.com/s/bom-garbage/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {"name": "curl", "version": "1"}
}
}'