MCP toggle via /mcp clears disabledMcpServers array, causing process exhaustion
Resolved 💬 3 comments Opened Apr 6, 2026 by Jesscha Closed May 16, 2026
Summary
When using /mcp to disable MCP servers, a file conflict during ~/.claude.json editing can cause disabledMcpServers to be set to [] (empty array), which re-enables all MCP servers instead of disabling them. This triggers a mass spawn of MCP server processes, exhausting the system process limit (kern.maxprocperuid) and making the system unresponsive — new terminal sessions cannot be opened.
Steps to Reproduce
- Have multiple MCP servers configured (e.g., figma, linear, gmail-mcp, notion, youtube-transcript)
- Use
/mcpto disable MCP servers - Claude Code attempts to edit
~/.claude.json - Edit fails with:
"Error: File content has changed since it was last read" - On retry, it clears the array:
- "disabledMcpServers": [
- "youtube-transcript"
- ]
+ "disabledMcpServers": []
- All previously disabled MCP servers are now re-enabled and spawn simultaneously
Impact
- All MCP servers start at once, creating many Node.js child processes
- System hits
kern.maxprocperuid(4000 on macOS) fork failed: resource temporarily unavailable— no new processes can be created- Terminal sessions cannot be opened; system becomes unusable until processes are force-killed via Activity Monitor
- This has happened multiple times, making Claude Code unreliable
Expected Behavior
/mcptoggle should not clear thedisabledMcpServersarray on file conflict- File edit retries should preserve the intended state (disabling, not enabling)
- Claude Code should not be able to exhaust the system process table
Environment
- Claude Code: 2.1.92
- macOS: 26.3 (Build 25D125)
- Shell: zsh + oh-my-zsh
- MCP servers: figma, linear, gmail-mcp, notion, youtube-transcript, claude.ai Gmail, claude.ai Google Calendar, claude.ai Notion
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗