MCP toggle via /mcp clears disabledMcpServers array, causing process exhaustion

Resolved 💬 1 comment Opened Apr 6, 2026 by jesse264 Closed Apr 6, 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

  1. Have multiple MCP servers configured (e.g., figma, linear, gmail-mcp, notion, youtube-transcript)
  2. Use /mcp to disable MCP servers
  3. Claude Code attempts to edit ~/.claude.json
  4. Edit fails with: "Error: File content has changed since it was last read"
  5. On retry, it clears the array:
-      "disabledMcpServers": [
-        "youtube-transcript"
-      ]
+      "disabledMcpServers": []
  1. 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

  • /mcp toggle should not clear the disabledMcpServers array 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

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗