claude-code - 💡(How to fix) Fix Feature request: hot-reload MCP servers without restarting the session [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46426Fetched 2026-04-11 06:20:36
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1

Fix Action

Fix / Workaround

Workaround today

RAW_BUFFERClick to expand / collapse

Problem

MCP servers are only loaded at session startup. If I run claude mcp add <name> ... during an active session (or edit ~/.claude.json directly), the new server is written to the config file but the running process doesn't pick it up. The only way to use the new MCP is to exit the session and relaunch Claude Code — which loses the in-memory conversation context mid-task.

This comes up a lot in real workflows:

  • User asks Claude to do something → Claude realizes partway through that an MCP would help → Claude installs it with claude mcp add → neither Claude nor the user can actually use it without restarting.
  • Adding an MCP for a task you're already in the middle of (e.g. PostHog MCP to query an analytics project you just created) forces a restart right when momentum matters.

Proposed fix

A /mcp reload slash command (or /mcp refresh) that re-reads the MCP config file and:

  1. Starts any newly-added servers
  2. Stops any removed servers
  3. Leaves existing servers untouched (or optionally restarts them with a flag like /mcp reload --restart-all)

Bonus: automatically trigger a reload when claude mcp add / claude mcp remove is run from within an active session, since the config file is already being written.

Workaround today

Exit and relaunch, losing in-session memory of where you were.

Why this is small

The MCP loader already exists — it runs once at startup. Making it callable mid-session should be mostly a matter of exposing it via a slash command and handling the diff between current and new config. No protocol changes needed.

extent analysis

TL;DR

Implementing a /mcp reload slash command to re-read the MCP config file and start or stop servers as needed is the most likely fix.

Guidance

  • Expose the existing MCP loader via a slash command to allow mid-session reloads
  • Handle the difference between the current and new config to determine which servers to start or stop
  • Consider automatically triggering a reload when claude mcp add or claude mcp remove is run from within an active session
  • Add an optional flag (e.g. --restart-all) to allow restarting all existing servers

Example

No explicit code example is provided, but the proposed fix suggests modifying the existing MCP loader to be callable mid-session.

Notes

The implementation details may vary depending on the specific architecture and codebase of Claude Code, but the general approach of exposing the MCP loader via a slash command seems feasible.

Recommendation

Apply workaround by implementing the proposed /mcp reload slash command, as it addresses the specific use case and provides a clear solution to the problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING