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
Is your feature request related to a problem? Please describe. CommandTransport.Close() currently hardcodes a 5s wait after closing stdin before escalating. This follows the MCP spec's "reasonable time" requirement, but the fixed value leads to noticeable delays (e.g., when testing with processes like sleep that never exit quickly).
Describe the solution you'd like
Make this timeout configurable via a TermGrace time.Duration field on CommandTransport. Default should remain 5 * time.Second to preserve current behavior.
Describe alternatives you've considered
Keeping the hardcoded 5s wait (current behavior) — but this hurts short-lived or test scenarios.
Manually killing the process from outside — works, but breaks the intended MCP shutdown sequence.
Additional context
The MCP spec requires a shutdown sequence of closing stdin → waiting a reasonable time → sending SIGTERM, but does not prescribe exact durations. Making TermGrace configurable would keep spec compliance while offering flexibility for different environments and use cases.