A stdio MCP server is about to exit. Its stdin just reached EOF. What — MCP Professional Practice — Claude Cert Academy

A stdio MCP server is about to exit. Its stdin just reached EOF. What is the correct shutdown behavior?

Answer: Finish all in-flight requests, then exit cleanly

EOF on stdin is the shutdown signal in stdio transport. The server should treat it as a graceful shutdown request: finish all in-flight requests, then exit. Calling process.exit() immediately would abandon in-flight operations and leave the client unable to know whether they completed.

Continue to Claude Cert Academy