MCP servers lose connection after /clear and /exit, requiring manual re-trigger
Description
MCP servers (particularly Notion, but likely all MCP servers) lose their connection after using /clear, /exit, and sometimes /compact. After these commands, MCP tools become unavailable until the user manually triggers a tool call from that server to force lazy-reload.
This is disruptive because:
- Users don't realize MCP is disconnected until they're deep into a workflow
- There's no automatic reconnection mechanism
- The workaround (manually triggering an MCP call) is not obvious
Steps to Reproduce
- Start a Claude Code session with MCP servers configured (e.g., Notion via
@notionhq/notion-mcp-server) - Verify MCP tools work (e.g., call a Notion read tool)
- Run
/clear(or/exitand restart) - Attempt to use the same MCP tool — it's no longer available in the deferred tools list
Expected Behavior
MCP servers should automatically reconnect after /clear, /exit, and /compact. At minimum:
/compactshould preserve MCP connections (it's just context compression, not a session reset)/clearshould re-initialize MCP connections as part of the reset- After
/exit+ newclaudelaunch, MCP servers should eagerly connect rather than lazy-load
Current Workaround
Added an "MCP health check" to startup instructions in CLAUDE.md that tells Claude to immediately trigger an MCP tool call on session start to force lazy-reload. This works but shouldn't be necessary.
Environment
- Claude Code (CLI)
- macOS (Apple Silicon)
- MCP servers configured in
.claude/settings.jsonundermcpServers - Affected servers:
notion-mcp-server, likely all MCP servers
Suggestion
Consider adding an MCP server health check / reconnection step to the /clear and post-/exit initialization flow. Even a simple "ping all configured MCP servers" during startup would prevent this class of issue.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗