claude-code - 💡(How to fix) Fix MCP tool schemas dropped after batch error array from restarted server [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#48165Fetched 2026-04-15 06:31:20
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

After an MCP server crashes and auto-restarts mid-request, Claude Code drops all cached tool schemas for that server. The restarted server is healthy and accepts connections, but the client can no longer call any of its tools — ToolSearch returns nothing. Only /mcp reconnect recovers.

Error Message

  1. The server crashes during cleanup after the first response — the remaining calls return error arrays from the auto-restarted instance The client should re-fetch tool schemas (tools/list) when it detects a server restart or reconnection, so the agent can act on recovery hints in the error response (e.g. "call open_idb again"). Tool schemas are gone. The server's improved error message ("the server may have restarted — call open_idb again") is useless because the agent can't invoke open_idb without the schema.

Root Cause

  1. Configure a stdio MCP server that can crash on specific inputs (e.g. ida-mcp decompiling certain functions triggers a Hex-Rays C++ segfault post-response)
  2. Call a batch tool that sends multiple requests (e.g. decompile([addr1, addr2, addr3]))
  3. The server crashes during cleanup after the first response — the remaining calls return error arrays from the auto-restarted instance
  4. After this, all tool calls to that server fail — not because the server is down (it restarted successfully) but because the client lost the tool schemas

Fix Action

Workaround

User manually runs /mcp to force reconnection.

RAW_BUFFERClick to expand / collapse

Summary

After an MCP server crashes and auto-restarts mid-request, Claude Code drops all cached tool schemas for that server. The restarted server is healthy and accepts connections, but the client can no longer call any of its tools — ToolSearch returns nothing. Only /mcp reconnect recovers.

Repro

  1. Configure a stdio MCP server that can crash on specific inputs (e.g. ida-mcp decompiling certain functions triggers a Hex-Rays C++ segfault post-response)
  2. Call a batch tool that sends multiple requests (e.g. decompile([addr1, addr2, addr3]))
  3. The server crashes during cleanup after the first response — the remaining calls return error arrays from the auto-restarted instance
  4. After this, all tool calls to that server fail — not because the server is down (it restarted successfully) but because the client lost the tool schemas

Expected

The client should re-fetch tool schemas (tools/list) when it detects a server restart or reconnection, so the agent can act on recovery hints in the error response (e.g. "call open_idb again").

Actual

Tool schemas are gone. The server's improved error message ("the server may have restarted — call open_idb again") is useless because the agent can't invoke open_idb without the schema.

Environment

  • Claude Code (latest as of 2026-04-14)
  • MCP server: ida-mcp v9.3.12 (stdio transport)
  • macOS Tahoe, Apple Silicon

Workaround

User manually runs /mcp to force reconnection.

extent analysis

TL;DR

The client should re-fetch tool schemas when detecting a server restart or reconnection to recover from lost cached tool schemas.

Guidance

  • Investigate the client's reconnection logic to ensure it triggers a tool schema refresh after a server restart.
  • Verify that the server's error response with recovery hints (e.g., "call open_idb again") is properly handled by the client to initiate schema re-fetching.
  • Consider implementing a periodic tool schema refresh mechanism to mitigate the issue in cases where the client fails to detect a server restart.
  • Review the client's caching strategy for tool schemas to determine if a more robust caching mechanism can be implemented to prevent schema loss during server restarts.

Example

No code snippet is provided as the issue does not contain sufficient technical details to create a specific example.

Notes

The provided workaround of manually running /mcp to force reconnection suggests that the issue is related to the client's ability to detect and respond to server restarts. However, without further information about the client's implementation, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Manually running /mcp to force reconnection is the most straightforward solution until a more robust client-side implementation can be developed to handle server restarts and tool schema caching.

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 MCP tool schemas dropped after batch error array from restarted server [1 comments, 2 participants]