-
Notifications
You must be signed in to change notification settings - Fork 3.6k
MCP Server with Python on Claude Desktop Never Exits #526
Copy link
Copy link
Open
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on
Metadata
Metadata
Assignees
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the bug
When using an MCP Server (stdio) installed in Claude Desktop with the command
uv run mcp istall server_test.pyand then closing Claude Desktop, the process mcp.exe remains active in Task Manager on Windows 10.If you open and close Claude Desktop again, the number of lingering mcp.exe processes increases.
To Reproduce
Steps to reproduce the behavior:
server_test.pyusing the command above.mcp.exeorpython.exestill running.Expected behavior
The process should exit cleanly when Claude Desktop is closed.
I tested the MCP server provided by the C# SDK, and it exits correctly — so the issue might be specific to the Python implementation or FastMCP.
Screenshots

Desktop