~/.claude.json mcpServers key silently dropped on session restart
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
- Have multiple MCP servers configured in
~/.claude.jsonundermcpServers - Use Claude Code normally (multiple sessions across different projects)
- Open
/mcpdialog or restart Claude Code session mcpServerskey 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.backupfrom 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/.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗