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
MCP STDIO: a clean end of input aborts the requests in flight and logs a warning #1765
Follow-up to #1706. Found while moving an MCP server onto the STDIO connector of org.restlet.ext.mcp (naftiko/ikanos#838).
StdioServerHelper treats a clean end of its input as a failure. When the reader gets end of stream, it calls fail(new IOException("MCP STDIO input ended")), which logs a WARNING with a stack trace, aborts every request still in flight and stops the stream.
So a client that sends its last request and then half-closes stdin, or a request piped into the server (echo '{...}' | server), loses the answer. Measured with one tools/list line followed by end of input: 611 bytes of answer from a plain line-by-line stdio handler, 0 bytes from the connector. Every normal client shutdown also logs a WARNING with a stack trace on stderr.
An end of input is how a stdio client says "no more requests", not a fault. The requests it already sent should be answered.
Delivery:
On a clean end of input, stop reading but let the requests in flight finish and write their answers, bounded by the request timeout. Requests that never end by themselves, such as a subscriptions/listen stream, are cancelled at once.
Then close as now. Whether getFailure() stays set for an ended input is for the connector's owners to monitor a subprocess by: keep it set, so they still see the end, but log it at FINE rather than WARNING (an I/O error on the input still fails and logs as now).
Tests: a request followed by end of input is answered before the connector closes; a listen stream is cancelled at the end; an I/O error still aborts the requests in flight.
Delivered by #1767 (merged to 3.0): endOfInput() waits for in-flight requests, cancels listen streams, then closes. Closing by hand because 3.0 merges don't auto-close.
Activity
Give the end of an MCP STDIO input a grace, cancel every listen, tell…
Test that a clean end of an MCP STDIO input is not logged as a warnin…
End the MCP STDIO connector at a clean end of input only once the req…
Give the end of an MCP STDIO input a grace, cancel every listen, tell…
Test that a clean end of an MCP STDIO input is not logged as a warnin…
Resolve the changes.md entries of #1764 and #1765 after the rebase
Resolve the changes.md entries of #1764 and #1765 after the rebase
jlouvel commentedon Nov 30, 2026
Delivered by #1767 (merged to 3.0): endOfInput() waits for in-flight requests, cancels listen streams, then closes. Closing by hand because 3.0 merges don't auto-close.