Skip to content

Clarify stdio-transport shutdown sequence for Windows #1090

Closed

Description

@crepererum

Is your feature request related to a problem? Please describe.
Currently the protocol spec states (link):

For the stdio transport, the client SHOULD initiate shutdown by:

  1. First, closing the input stream to the child process (the server)
  2. Waiting for the server to exit, or sending SIGTERM if the server does not exit within a reasonable time
  3. Sending SIGKILL if the server does not exit within a reasonable time after SIGTERM

The server MAY initiate shutdown by closing its output stream to the client and exiting.

On Windows there are no SIGTERM and SIGKILL though.

Describe the solution you'd like
Clarify the signaling mechanism on Windows.

Describe alternatives you've considered
Not providing any signaling mechanism on windows, i.e. leave point 2 and 3 not applicable.

Additional context
-

Activity

  1. added
    enhancement
    on Jul 30, 2025
  2. added theissue type on Jul 31, 2025
  3. added this to the DRAFT-XX-XX milestone on Jul 31, 2025
  4. localden commented on Aug 1, 2025

    @localden
    Contributor

    Reaching out to a few folks at Microsoft to see if we can contribute an improved recommendation.

  5. LarryOsterman commented on Aug 1, 2025

    @LarryOsterman

    For Windows, SIGTERM can be simulated by calling TerminateProcess with the child process ID. It's the equivalent of kill -f so doesn't give the application the ability to gracefully exit.

  6. LarryOsterman commented on Aug 1, 2025

    @LarryOsterman

    I would probably also add verbiage indicating that the MCP server MUST terminate gracefully when it encounters errors reading from or writing to stdio streams - that's important because it indicates that the host is gone. And it dramatically reduces the probability that the host needs to consider killing the server.

  7. added 2 commits that reference this issue on Mar 25, 2026
    98f21a4
    a7f693a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions