Skip to content

Fix STDIO transport stream errors on client disconnect #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

CodeWithKyrian
Copy link
Contributor

When MCP clients disconnect from STDIO transport, they close STDOUT/STDERR streams before the Laravel command completes. Attempting to output "MCP Server (STDIO) stopped." to closed streams causes fwrite() errors.

This PR removes the output message since STDIO transport should complete silently when clients disconnect - this is normal behavior, not an error condition.

When MCP clients disconnect from STDIO transport, they close STDOUT/STDERR
streams before the Laravel command completes. Attempting to output
"MCP Server (STDIO) stopped." to closed streams causes fwrite() errors.
@CodeWithKyrian CodeWithKyrian linked an issue Jun 25, 2025 that may be closed by this pull request
@CodeWithKyrian CodeWithKyrian merged commit 8d08df8 into main Jun 25, 2025
8 checks passed
@CodeWithKyrian CodeWithKyrian deleted the 22-fix-supplied-resource-is-not-a-valid-stream-resource branch June 25, 2025 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Starting MCP server with STDIO transport" Log breaks MCP
1 participant