~/.claude.json mcpServers key silently dropped on session restart

Resolved 💬 3 comments Opened Mar 10, 2026 by w3geekery Closed Mar 14, 2026

Description

The mcpServers key in ~/.claude.json was silently removed during what appears to be a Claude Code session restart or internal config rewrite. All other keys in the file were preserved (numStartups, tipsHistory, oauthAccount, etc.), but mcpServers — containing 6 configured MCP servers — was completely stripped.

No user action or Claude session edited the file. The /mcp dialog was opened shortly before discovering the issue, which may be related.

Steps to Reproduce

  1. Have multiple MCP servers configured in ~/.claude.json under mcpServers
  2. Use Claude Code normally (multiple sessions across different projects)
  3. Open /mcp dialog or restart Claude Code session
  4. mcpServers key is gone from ~/.claude.json

Expected Behavior

mcpServers should be preserved when Claude Code rewrites ~/.claude.json for internal state persistence.

Actual Behavior

mcpServers key was completely removed. All other top-level keys were retained. The file was rewritten at 2026-03-10 ~09:40 PDT.

Evidence

  • No shell history shows any manual edit to ~/.claude.json
  • No SpecStory session history (searched all ~/Projects/**/.specstory/history/) shows any Claude session editing the file
  • The file modification timestamp corresponds to a Claude Code startup, not a user action
  • A .claude.json.backup from January still had the servers; the live file did not

Environment

  • macOS Darwin 24.6.0
  • Claude Code (latest as of 2026-03-10)
  • 6 MCP servers configured: atlassian, google-sheets, zerobias, Neon, timetracker, chrome-devtools

Workaround

Manually restored mcpServers from backup. Now keeping a separate backup at ~/backups/.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗