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
{{ message }}
Repository navigation
StdioTransport traps ("Negative value is not representable") when stdio is a socket, e.g. spawned by Node clients #327
Since #297 (merged 2026-10-31, on main, not in 0.12.1), StdioTransport.connect() traps when stdin/stdout is a socket:
Fatal error: Negative value is not representable
Node's child_process.spawn with stdio: 'pipe' uses socketpairs on macOS, and fstat on a socket reports st_dev == -1. dev_t is signed (Int32 on Darwin), so UInt64(status.st_dev) traps. Every Node-based MCP client hits this: Claude Desktop and Claude Code both report "Connection closed" right after initialize.
Hi, I've opened #334 fixing this with the bit-pattern conversion suggested above, plus a socketpair regression test. Happy to adjust if maintainers prefer a different approach.
Fixed on rel/1.0.0 (#372) in #413: StdioTransport no longer mutates O_NONBLOCK or reads UInt64(status.st_dev) at all. It now watches descriptors via DispatchSource checking status.st_mode & S_IFMT (explicitly supporting S_IFSOCK socketpairs, with regression coverage in StdioTransportTests). Closing as resolved in 1.0.0.
Activity
NayanBhut commentedon Nov 23, 2026
Hi, I've opened #334 fixing this with the bit-pattern conversion suggested above, plus a socketpair regression test. Happy to adjust if maintainers prefer a different approach.
jeanmatthieu commentedon Dec 5, 2026
Fixed on
rel/1.0.0(#372) in #413:StdioTransportno longer mutatesO_NONBLOCKor readsUInt64(status.st_dev)at all. It now watches descriptors viaDispatchSourcecheckingstatus.st_mode & S_IFMT(explicitly supportingS_IFSOCKsocketpairs, with regression coverage inStdioTransportTests). Closing as resolved in 1.0.0.