Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DGuhr opened this issue Mar 30, 2025 · 5 comments
Closed

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

DGuhr opened this issue Mar 30, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@DGuhr
Copy link
Contributor

DGuhr commented Mar 30, 2025

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

@DGuhr DGuhr added the bug Something isn't working label Mar 30, 2025
@stephentoub
Copy link
Contributor

The client is supposed to kill the spawned process, but in cases of non-conformant or on-graceful shutdown when it doesn't, the server should automatically go away with #142.

@DGuhr
Copy link
Contributor Author

DGuhr commented Mar 30, 2025

Thanks for the information, then let's wait to see if this solves it 👍 I tried to implement my own lifetime management, which worked when starting the server in the IDE, but led to the tools not showing up in claude desktop at all, so I hope your PR solves it.

@eiriktsarpalis
Copy link
Contributor

Fixed by #142.

@DGuhr
Copy link
Contributor Author

DGuhr commented Mar 31, 2025

Is this already released by any chance?

@eiriktsarpalis
Copy link
Contributor

Not yet. If you want you can try testing using a local build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants