Startup · troubleshooting record
MCP server exited unexpectedly after launch
The process started but terminated before or during initialization. The root cause can be a missing dependency, invalid arguments, a crash in the server, a port conflict, or a client that closes stdin.
Symptoms
- Client reports server exited, connection closed, or transport closed.
- Tools disappear after a brief connection.
- The process works manually but exits immediately under the client.
Confirmed causes
These causes have a documented basis. They may not be the cause of your specific failure.
The server writes diagnostics to stdout
stdio MCP uses stdout for protocol messages; non-protocol output can break framing and cause the client to close the connection.
Missing environment variables or invalid startup arguments
A server that requires a token or path often exits during startup when it is absent.
A port or resource conflict for a server that opens a local port
Servers that combine stdio with an HTTP listener can fail when the port is already bound.
Possible causes
- The client terminated the server because initialization timed out.
- The server crashed on an unhandled exception.
- The container image or package version does not match the documented command.
- The server expects a different transport mode, such as HTTP instead of stdio.
What still needs verification
- The server's stderr output at startup.
- Whether the server's README says logs go to stderr.
- Whether the client enforces an initialization timeout shorter than the server's startup time.
Affected environments
Fixes
Run the server manually and capture stderr
- Run the exact command from the client in a terminal.
- Send a minimal initialize request or use the server's documented test mode.
- Inspect stderr for the actual exception rather than guessing.
Remove stdout logging and supply required environment
- Configure the server to log only to stderr.
- Provide required environment variables and valid file paths.
- Use a supported package version and transport mode.
Verify the fix
- The manual process remains alive until stdin closes.
- No non-JSON text appears on stdout.
- The client shows the server connected and lists tools.
Paste the configuration into the Config Doctor. It runs in your browser, never uploads the file, and can show structural issues and safe fixes.
Why we believe this
- modelcontextprotocol.io/specification/2026-07-28/basic/transportsOfficial documentation · checked Oct 23, 2026 · documented
The stdio transport specification defines message framing and standard input/output behavior.