You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(server): resolve stdio server context cancellation bug (#331)
* fix(server): resolve stdio server context cancellation bug
Fix a critical bug in the stdio server's readNextLine function that was
causing "Error reading input" and "context cancelled" errors when Claude
Desktop attempted to connect to MCP servers.
The issue was in the select-default pattern that would immediately bypass
context cancellation checks and proceed with blocking ReadString operations
even when the context was cancelled. This prevented proper cleanup and
caused connection failures.
Changes:
- Remove problematic select-default pattern in readNextLine goroutine
- Simplify the read logic to directly call reader.ReadString('\n')
- Maintain proper done channel handling for result communication
- Ensure context cancellation is respected throughout the read operation
This resolves connection issues introduced in version 0.30.0 where the
stdio transport became unreliable for client connections.
Fixes: stdio server connection failures with Claude Desktop
* refactor: remove redudant signaling channels
---------
Co-authored-by: Marcos <[email protected]>
0 commit comments