/clear does not terminate previous stdio MCP server child processes (unlike /mcp reload )
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 11.2k
- Forks
- 1.9k
- Avg merge
- 14h 16m
- Merged PRs (30d)
- 6
Description
Description
When reloading MCP servers with /mcp reload, the CLI correctly terminates the existing stdio MCP server child process before starting a new one. However, running /clear (start fresh session) spawns a new stdio MCP server process without terminating the previous session's MCP server process, leaking orphaned processes over time.
Steps to reproduce
- Start a session with a stdio-based MCP server configured (e.g. a custom
*.exeMCP server). - Confirm the server process is running (e.g. via Task Manager /
Get-Process). - Run
/clear. - Observe: a new instance of the MCP server process starts, but the previous one is still running.
- Repeat
/clearmultiple times — orphaned process count grows unbounded. - Contrast with
/mcp reload, which correctly stops the old process before starting the new one.
Expected behavior
/clear should terminate/clean up MCP server child processes from the previous session (or reuse them) before/while starting the new session's servers, matching the behavior of /mcp reload.
Actual behavior
Old MCP stdio server processes are left running indefinitely after /clear, accumulating over repeated use (observed 22+ orphaned exe instances in one session).
Environment
- Copilot CLI version: 1.0.82
- OS: Windows
- MCP server type: stdio-based custom MCP server
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Reproduce on Windows with a stdio MCP server, then trace the /clear session reset alongside the existing /mcp reload cleanup path. Done means repeated /clear commands do not leave previous MCP child processes running and existing reload behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100