github / github/copilot-cli

/clear and /restart breaks mcp integration

Open
#4,772 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area:mcp area:sessions
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

/clear and /restart leave MCP tools broken; only /mcp reload recovers them

Description

After running /clear (and also /restart), MCP tools stop working correctly in the new session. Restarting the CLI process from scratch (full exit + relaunch) works fine, so the issue is isolated to in-process session/state carryover — not the MCP server config itself. Running /mcp reload after /clear or /restart fixes it without needing a full process exit.

Steps to reproduce
  1. Start a session with MCP servers configured and working.
  2. Use MCP tools normally — confirm they work.
  3. Run /clear.
  4. Try to use an MCP tool — it fails / tools are unavailable.
  5. Run /restart — issue persists.
  6. Run /mcp reload — MCP tools work again.
  7. Alternatively, fully exit and relaunch the CLI — works fine on first try.
Expected behavior

/clear and /restart should leave MCP tools in the same working state as a fresh CLI launch, without requiring a manual /mcp reload.

Environment
  • Copilot CLI version: 1.0.83
  • OS: Linux
  • Related: possibly same root cause as #4697 (/clear doesn't terminate previous stdio MCP server child processes)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the /clear, /restart, and /mcp reload command handling and the in-process MCP session/state lifecycle described here. Compare those paths with a fresh CLI launch and the related issue #4697; done means MCP tools remain available after /clear and /restart without requiring /mcp reload.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.