Feature Request: MCP Tool Caching and Hot-Reload Support
Summary
MCP tools are only discovered at Claude Code startup. If an MCP server isn't running when Claude Code starts, those tools are unavailable for the entire session. This creates a poor user experience for MCP servers that depend on external applications (like Ghidra, IDEs, or other GUI tools) that may not be running at Claude Code launch time.
Problem Description
Current Behavior
- Claude Code starts and reads
~/.claude/mcp.json - Attempts to connect to each configured MCP server
- Discovers tools dynamically via MCP protocol
- If a server is down → no tools discovered → tools unavailable for entire session
- Tool list is fixed for session lifetime - no way to refresh
Real-World Impact
Many valuable MCP integrations depend on external applications:
- Ghidra (reverse engineering) - must have GUI open with program loaded
- IDE integrations - editor must be running
- Database tools - connections may not be ready at startup
- Docker-based servers - containers may start after Claude Code
Users must carefully orchestrate startup order: start all MCP dependencies first, wait for them to be ready, then start Claude Code. If anything restarts mid-session, those tools become unavailable until Claude Code is restarted.
Proposed Solutions
Option 1: Hot-Reload MCP Tools (Preferred)
Add a command to re-discover MCP tools mid-session:
/mcp-reload # Reload all MCP servers
/mcp-reload ghidrassistmcp # Reload specific server
Benefits:
- Server comes online → user runs
/mcp-reload→ tools become available - No session restart required
- Simple mental model
Option 2: Tool Schema Caching
Cache last-known tool definitions to disk:
~/.claude/mcp-cache/
ghidrassistmcp.json # Cached tool schemas
ghydramcp.json
Behavior:
- If server is down at startup, load cached tool definitions
- Mark tools as "cached/unverified"
- When tool is called, attempt to connect to server
- If server now available, validate cached schema matches
- Refresh cache when server responds
Benefits:
- Tools always available if previously discovered
- Graceful degradation when servers are temporarily down
- Lazy connection - don't block startup
Option 3: Background Retry with Notification
- If MCP server fails at startup, retry connection periodically in background
- When server becomes available, notify user: "MCP server 'ghidrassistmcp' is now available (40 tools)"
- Integrate newly discovered tools into session
Environment
- Claude Code version: Latest (as of Jan 2025)
- OS: Linux (Ubuntu-based)
- MCP servers affected: Any server depending on external applications
Use Case: Ghidra Integration
I use GhidrAssistMCP which provides 40 tools for reverse engineering:
get_program_info(),decompile_function(),xrefs_to(), etc.- Server runs inside Ghidra GUI on port 8888
- Ghidra must be open with a program loaded before the MCP server is available
Current workflow (frustrating):
- Open Ghidra, load binary
- Enable GhidrAssistMCP plugin (Window → GhidrAssistMCP)
- Verify port 8888 is listening
- Only then start Claude Code
- If Ghidra crashes or restarts → must restart Claude Code too
Desired workflow:
- Start Claude Code anytime
- Open Ghidra when needed
- Run
/mcp-reloador have tools auto-discover - Continue working seamlessly
Additional Context
The MCP protocol itself supports dynamic tool discovery - servers can add/remove tools at runtime. Claude Code could leverage this by periodically re-querying tool lists or providing manual refresh capability.
This would significantly improve the developer experience for MCP integrations that depend on external applications, making the MCP ecosystem more practical for real-world workflows.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗