Skip to content

StdioClientTransport does not follow the spec on close #579

Open
@pavelfeldman

Description

@pavelfeldman

As per https://modelcontextprotocol.io/specification/2025-03-26/basic/lifecycle#stdio

For the stdio transport the client SHOULD initiate shutdown by
- First, closing the input stream to the child process (the server)
- Waiting for the server to exit, or sending SIGTERM if the server does not exit within a reasonable time
- Sending SIGKILL if the server does not exit within a reasonable time after SIGTERM

None of this is happening, only SIGTERM is sent in the current code: https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/client/stdio.ts#L202

As a result MCP server can't exit cleanly on Windows. Non-Windows platforms exit cleanly as per SIGTERM handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions