claude-code - 💡(How to fix) Fix Feature Request: Hot-reload MCP servers without restarting session [2 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#52470Fetched 2026-04-24 06:06:21
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×3commented ×2closed ×1

This is the same hot-reload pattern Claude Code already supports for hooks (settings changes take effect on next hook invocation). MCP servers should follow the same principle.

Root Cause

This is the same hot-reload pattern Claude Code already supports for hooks (settings changes take effect on next hook invocation). MCP servers should follow the same principle.

RAW_BUFFERClick to expand / collapse

When MCP servers are added or modified in ~/.claude/settings.json (or project-level settings), the changes only take effect on a new session. Continued or resumed sessions retain the MCP server list from when they started. There is no way to pick up new MCP tools without losing session context.

Use case

Multi-agent workflows frequently evolve infrastructure mid-session. Adding a new MCP server (e.g., an orchestration tool, a new data source, a monitoring endpoint) should not require abandoning accumulated session context.

In our case: we added an llm-relay MCP server (8 tools for cross-provider delegation) to global settings while an agent session was active. The agent confirmed the tools were documented in its CLAUDE.md but could not access them — they were not in its tool set. The only fix was to exit and start a fresh session, losing 182K tokens of accumulated context.

Current behavior

MCP server list is loaded once at session start. Changes to settings during a session are invisible.

Requested behavior

Detect when MCP server configuration changes and hot-reload the server connections. Either:

  1. Automatically on settings file change (preferred)
  2. Via a /mcp reload command
  3. At minimum, on /compact or /continue (session continuity points that already re-evaluate state)

Context

This is the same hot-reload pattern Claude Code already supports for hooks (settings changes take effect on next hook invocation). MCP servers should follow the same principle.

extent analysis

TL;DR

Implementing a hot-reload mechanism for MCP server connections, similar to the existing hook settings update pattern, is likely the most effective fix.

Guidance

  • Investigate the current session management and MCP server loading logic to identify where changes can be made to support hot-reloading.
  • Consider implementing a file watcher or periodic check for changes to the ~/.claude/settings.json file to trigger a reload of MCP server connections.
  • Evaluate the feasibility of adding a /mcp reload command as a fallback or alternative to automatic hot-reloading.
  • Review the existing hook update mechanism to determine if similar code or patterns can be applied to MCP server connections.

Example

No specific code example can be provided without more context, but the implementation might involve modifying the session initialization or settings loading functions to include a mechanism for detecting changes and reloading MCP server connections.

Notes

The exact implementation details will depend on the specific architecture and codebase of the Claude system, and may require additional considerations for handling session context and continuity.

Recommendation

Apply a workaround by implementing a hot-reload mechanism, as this aligns with the existing pattern for hook settings updates and addresses the core issue of needing to reload MCP server connections without losing session context.

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

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