Skip to content

Spawned dotnet processes via MCP do not get cleaned up #148

@DGuhr

Description

@DGuhr

Describe the bug
I have an MCP like this one:

{
"mcpServers": {
"MyMCP": {
"command": "dotnet",
"args": [
"run",
"--project",
"/Users/me/git/dguhr/MyMCP",
"--no-build"
]
}
}
}

and configured like in the docs example (which is broken btw, issue #230 in that repository, PR with fix is there, awaits review).

Now I start up claude as client and see it working - great. but looking into the activity monitor I see that after a few restarts of claude there are multiple dotnet processes spawned that do not get killed so I have to do it manually.

To Reproduce
Steps to reproduce the behavior:

  1. Build an MCP as per this quickstart with the C# SDK

Expected behavior
I'd have hoped that the SDK somehow knows when the client quits and kills all spawned processes. If not, at least the example should be made clearer with steps to mitigate this behaviour.

Logs

Additional context
running on a M3 Macbook Pro

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