| feat(mcp): skip non-protocol stdout lines from noisy stdio servers
Some third-party MCP servers incorrectly print status logs to stdout
after initialization, causing an immediate transport error. Change the
stdio transport to skip plain-text lines (up to 100) between protocol
messages instead of bailing, making these servers usable while still
failing on truly malformed or infinite non-protocol output.
- recv_jsonrpc_response now loops past non-JSON/Content-Length lines
- Add MAX_SKIP_LINES=100 guard to prevent infinite loops
- Add env-gated noise (MCP_TEST_STDOUT_NOISE_AFTER_INITIALIZED) to
mock test server for testing this scenario
- Add integration tests for both noisy and clean stdio servers
| 29 天前 |