Agents view: MCP servers added mid-session never load (bg-spare keeps the config it started with, /exit doesn't end the process)
Since about October 2025, every MCP server I've added through Claude Code has failed to show up in /mcp until I find some way to fully restart. It has happened seven or eight times. Each part may be working as designed, but put together they mean a new MCP server can't be used without killing every background session.
What happens
- In an agents-view session, I ask Claude to add a server. It runs
claude mcp add base44 --scope user --transport http https://app.base44.com/mcpand reports success. claude mcp get base44says "Needs authentication", and~/.claude.jsonnow has six servers undermcpServers./mcpin the same session shows only the five older user servers. base44 isn't there, so I can't authenticate it.- Claude suggests
/exitand resuming. I run/exitin agents view and reopen the session./mcpstill doesn't show base44.
Why
- Agents-view sessions run inside
claude bg-spareprocesses that the daemon starts ahead of time. A spare reads the MCP config when it starts and doesn't read it again. /exitin agents view doesn't end that process. Before and after/exit, my session was the same process (pid 6625, started 18:25:43 local).- Each time a spare is claimed, the daemon starts another one right away. So even a "fresh" resume can land in a spare that started before the config changed.
From ~/.claude/daemon.log (UTC):
23:25:43.924Z bg spare spawned host pid=6618
23:26:55.187Z bg claimed-spare c6f3290a (fleet)
23:26:55.195Z bg spare spawned host pid=8327
# claude mcp add ran around 23:30Z
23:39:04.530Z bg claimed-spare 703a45b4 (spare)
The only reliable fix I've found is claude daemon stop, which kills every background session I have running.
What would fix it
Any one of these would do:
- Have
/mcpre-read the MCP config files and connect any servers that are new since the session started. - Have
claude mcp addnotify the daemon so it replaces stale spares and running sessions can pick up the new server. - Make
/exitin agents view actually end the process, or add a per-session "restart" action in agents view. - At the very least, have
/mcpsay something like "1 server in ~/.claude.json isn't loaded in this session; restart it to connect." The model also tells users the server is ready when it isn't, so it would help if it knew about this.
Related
#40059, #46426 and #34893 (MCP reload without restart, all closed), #81042 (no mid-session reload), and #77649 (daemon re-forking sessions). None of them covers the agents-view and bg-spare side of this.
Environment
Claude Code 2.1.293, Linux Mint (kernel 7.0), agents view with the background daemon (claude daemon run --origin transient).