Repository navigation
[Client] Report the stdio server's exit code and stderr when it dies - #514
Conversation
|
Hi @ousamabenyounes, thanks for the patch - we missed some higher level integration tests for the client which I fixed with #540 and also catched some issues with our implementation. Please rebase your branch on |
Fixes modelcontextprotocol#332. Co-authored-by: Christopher Hertel <mail@christopher-hertel.de>
7d6186f to
b50d80f
Compare
|
Hi @ousamabenyounes, I took this over and rebased it on What #332 really asks for was still missing tho: the exit code and stderr in the error. So I kept your stderr tail and the reset on respawn, and attached both to the existing failure. You stay the author. Thanks for your work on this! 🙏 |
There was a problem hiding this comment.
🟡 Changes recommended
Unbounded stderr draining can hang requests, and signal termination is incorrectly reported as exit code -1.
2 open findings
What changed in this PR
Improves stdio server startup diagnostics by reporting exit status and recent stderr output.
Changes:
- Buffers the latest 8 KiB of stderr.
- Reports process exit details and resets diagnostics on retries.
- Adds regression tests and updates documentation.
| File | Description |
|---|---|
src/Client/Transport/StdioTransport.php |
Captures stderr and determines process exit reasons. |
tests/Unit/Client/Transport/StdioTransportTest.php |
Tests exit reporting, buffer limits, and retries. |
tests/Integration/IntegrationTestCase.php |
Updates failure-diagnostic commentary. |
CHANGELOG.md |
Documents improved stdio diagnostics. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Hi @chr-hertel ! i was fixing it and just saw your message now so i just stopped the fix :) so happy to contribute on this project :)... |


Fixes #332.
A stdio server dying on startup failed with "The server process closed its output; it is no longer running." - fast since #547, but without saying why. Now: