Feature request: hot-reload MCP servers without restarting the session

Status Closed — not planned
Maintainer reply ✓ Yes — localden
Activity 5 comments · opened Apr 10, 2026 · closed May 5, 2026
💡 Likely answer: A maintainer (localden, collaborator) responded on this thread — see the highlighted reply below.

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.

View original on GitHub ↗

5 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/40059
  2. https://github.com/anthropics/claude-code/issues/36643
  3. https://github.com/anthropics/claude-code/issues/2756

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

leomuzzi · 6 months ago

This is also useful for injecting narrow-scoped credentials mid-session for JIT access.

ssimmons1972 · 6 months ago

Real-world use case: 8 restarts in one session while expanding MCP estate

We manage a platform with ~10 MCP servers (custom + Azure + Dataverse + GitHub + MS Enterprise). During a session that added 4 new MCPs, renamed one, and debugged auth on another, we hit the full-restart requirement 8 times in a single morning.

Pain points specific to our workflow:

  1. /mcp reconnect only re-SIGHUP's servers known at session start. New entries in .claude.json (or renamed keys) don't appear until full exit + relaunch. This is the primary blocker — we can't incrementally expand MCP tooling mid-session.
  1. Each restart is a context-window cache miss (~60s rebuild on a large project) + loss of in-flight conversation state. With 10 MCP servers, startup alone takes 15–20s as each server initializes.
  1. The workaround pattern we developed: batch all .claude.json edits before a single restart. But during debug cycles (auth fails, try different config, retry), batching isn't possible.

What would help:

  • /mcp reconnect <name> re-reads .claude.json for that specific entry (picks up new keys, changed paths, new env vars)
  • /mcp add <name> registers a new MCP mid-session from .claude.json without touching existing servers
  • Bonus: /mcp remove <name> unloads a server mid-session (for dead entries that waste startup time)

Environment: Claude Code CLI on headless Linux, Opus model, 10 MCP servers (6 stdio, 1 docker, 3 HTTP-proxied).

localden collaborator · 5 months ago

Thank you for your report — we are currently in the process of triaging MCP-related issues and this one appears to describe the same problem as #24057. To keep the discussion and any fix in one place, we're consolidating into that issue and closing this one. If you have logs, repro steps, or environment details that aren't already covered in #24057, please add them there — it'll help us track this down faster.

github-actions[bot] · 3 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.