Skip to content

On Windows, StdioClientTransport calls taskkill and triggers visible cmd windows #420

@JesseCol

Description

@JesseCol

Describe the bug
When a StdioClientTransport shuts down, and the server-side process is still alive, MCP calls taskkill here.

04 ModelContextProtocol!ModelContextProtocol.Utils.ProcessHelper.RunProcessAndWaitForExit
05 ModelContextProtocol!ModelContextProtocol.Utils.ProcessHelper.KillTree
06 ModelContextProtocol!ModelContextProtocol.Protocol.Transport.StdioClientTransport.DisposeProcess
07 ModelContextProtocol!ModelContextProtocol.Protocol.Transport.StdioClientSessionTransport.CleanupAsync

When it does this, it triggers a visible cmd window on the user's machine.

I believe we can fix this by setting ProcessStartInfo.CreateNoWindow = true.

To Reproduce
I believe you just need to use STDIO transport, and close it on the client side.

Expected behavior
I expect taskkill to run without popping up any windows.

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