MCP Configuration Unexpectedly Deleted From File During Auto-Update

Resolved 💬 29 comments Opened Jun 8, 2025 by amcaplan Closed Jun 20, 2025
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Bug Description
Claude Code seems to frequently delete my MCP server configuration in ~/.claude.json, and I need to rebuild it from scratch. It's incredibly irritating, as I don't necessarily have offhand the information to recreate the servers, because I don't expect Claude Code to delete it! I suspect it's happening when there's an auto-update, but there isn't really indication of this... I do know that I will also get prompted with some basic setup info (color scheme, trust files, terminal-setup) and then I'll run /mcp and all of a sudden no servers are found.

Otherwise, awesome tool, love you all! ❤

Environment Info

  • Platform: macos
  • Terminal: Apple_Terminal
  • Version: 1.0.17
  • Feedback ID:

Errors

[{"error":"AxiosError: Request failed with status code 401\n    at uH (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:528:1070)\n    at IncomingMessage.wA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:529:9969)\n    at IncomingMessage.emit (node:events:519:35)\n    at IncomingMessage.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1696:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n    at ec.request (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:531:2081)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async qV5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1945:600)\n    at async Promise.all (index 0)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1931:19563","timestamp":"2025-06-08T11:57:51.449Z"}]

(I think the errors are from the failure to submit a bug report through /bug but aren't related to this)

View original on GitHub ↗

29 Comments

bradyounge · 1 year ago

This happened to me running claude code cli in wsl. Figured I'd provide the additional info. Unbelievable coding agent!!!

beyondoscar · 1 year ago

Can confirm this has happened to me after an update this morning.

doogie-bigmack · 1 year ago

Happens to me too, we should be able to kick off @claude on this issue to help them fix it!

ashwin-ant collaborator · 1 year ago

Hi, sorry to hear this. Did it just happen randomly during a session?

TrainerHol · 1 year ago

I'm having the same issue.
To recreate: Start WSL CLI and set up MCP server. Then start new WSL session on another window/tab and it'll be gone.

dinhphieu · 1 year ago

Just had this happen to me too, I thought I was going crazy

I simply opened a new Claude Code session in another tab in WSL. Maybe some concurrency issues, older tab taking over, etc etc?

lasergoat · 1 year ago

Same here!

I had imported the mcp from Claude desktop and fortunately it doesn't delete the config file there.

For anyone suffering this issue, here's at least a quick way to get your mcp working again (IF it's an mcp in claud desktop):

claude mcp remove mcp-name
claude mcp add-from-claude-desktop -s user

# then, pick the mcp from the list
beyondoscar · 1 year ago
Same here! I had imported the mcp from Claude desktop and fortunately it doesn't delete the config file there. For anyone suffering this issue, here's at least a quick way to get your mcp working again (IF it's an mcp in claud desktop): `` claude mcp remove mcp-name claude mcp add-from-claude-desktop -s user # then, pick the mcp from the list ``

That's interesting; I assumed this was linux specific. Have done similar in the interim though (saved mcp json body to file and run a bash script to re-add it to config).

sdsys-ch · 1 year ago

Can confirm.

Not only lost mcp server configurations but all project data saved inside ~/.claude.json on MacOS 15.5 running Claude Code under zsh+iterm. Claude Code is installed locally under ~/.claude/local. My ~/.claude/settings.json is just an empty obj.

After the problematic update, claude.json contained only:

{
  "autoUpdaterStatus": "migrated"
}

I used a Time Machine backup to get the last working configuration replacing the above, ran claude update where latest version 1.0.25 was confirmed as already installed, started inside a project and it was "back to normal". File size is quite large though:

~|⇒ du -h .claude.json
656K	.claude.json
~|⇒
khairm · 1 year ago

OK this is killing me now. Very consistently when a new terminal is opened all existing terminals lose their mcps. Anyone have a workaround?

mculp · 1 year ago

This happened to me today.

I can add back my old ~/.claude.json then run the claude executable and watch the file get deleted again.

But I did figure out why it’s happening.

If you have a JSON error in your config when you run claude, it immediately exits, and shows you this:

!Image

However, if you scroll up, you’ll see this:

!Image

This is moot at this point, because your config has already been deleted and claude already exited.

It took me about 5 times to realize this dialog was displaying above the prompt in my shell.

tldr, look for an error in your config file

mine was actually a commented out line, which is invalid JSON in most cases! I had forgotten that since vscode allows comments in JSON config files.

also could be root cause of #1983

ashwin-ant collaborator · 1 year ago

When this happens, are you using multiple Claude Code sessions in different terminal tabs?

mculp · 1 year ago

No. Give me a bit and I’ll post a screen recording.

mculp · 1 year ago

@ashwin-ant probably should’ve shown the ps aux at the beginning instead of end, but just trust me, no other claude was running

the configuration error is really hard to notice! (and pointless since claude’s already dead at that point)

https://github.com/user-attachments/assets/09c64fff-9ab4-4476-95b4-0fa08243f13e

ashwin-ant collaborator · 1 year ago

@mculp thank you, really appreciate the detailed bug report. We have a fix on the way, I'll update this issue once it's released.

ashwin-ant collaborator · 1 year ago

Hey all, this should be fixed in version 1.0.31. Sorry for the delay here, please keep the feedback coming!

mintmcqueen · 1 year ago

@ashwin-ant just happened to me during update to 1.0.34

Joe-Simo · 1 year ago
Same here! I had imported the mcp from Claude desktop and fortunately it doesn't delete the config file there. For anyone suffering this issue, here's at least a quick way to get your mcp working again (IF it's an mcp in claud desktop): `` claude mcp remove mcp-name claude mcp add-from-claude-desktop -s user # then, pick the mcp from the list ``

You saved my life, MCPs dissapeared after todays update too but luckily I also had them in claude desktop

khairm · 1 year ago

Is this back? My mcps are wiping every terminal load again (was working fine past few days).

Joe-Simo · 1 year ago
Is this back? My mcps are wiping every terminal load again (was working fine past few days).

Every new update claude code wipes all my MCP so im constantly having to have a backup on my claude desktop so I can re-add them

claude mcp add-from-claude-desktop -s user

# then, pick the mcp from the list
ashwin-ant collaborator · 1 year ago

Is it strictly your MCP servers that get wiped, or is it also that you're getting logged out completely? We have a known issue with people getting fully logged out that sometimes occurs when you have multiple Claude sessions running. Is that what you're seeing @josephsimo?

Joe-Simo · 1 year ago
Is it strictly your MCP servers that get wiped, or is it also that you're getting logged out completely? We have a known issue with people getting fully logged out that sometimes occurs when you have multiple Claude sessions running. Is that what you're seeing @josephsimo?

Everything is fine, then I see on x that there is a new update, I open terminal, type Claude and I'm logged out...I can see an update was made, I login again and all my mcps are gone, everything else including the .md is intact.

Has happened 3 times in a row now, new update, I'm logged out, login and MCPs are wiped.

eugeneoshepkov · 1 year ago

Same here, happened multiple times already - after logging out my MCPs get wiped out. 1.0.43 (Claude Code)

noops888 · 11 months ago

This just started happening out of the blue for me yesterday on both macOS and Linux.

Motaphe · 11 months ago

yea, my MCPs keep disappearing everytime i close and reopen WSL. It remembers my account and other settings tho! The .claude.json file still exists at the same location with the same file content (even including the MCP conf) but claude code doesnt load the MCPs.

blueberry6401 · 11 months ago

Everyday my sub-agents get super confused when I tell them to use MCP. Turns out MCP’s been deleted 😂

blueberry6401 · 11 months ago

My MCPs are getting cleared after several hours. I imported them from claude desktop.

github-actions[bot] · 11 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.