claude-code - 💡(How to fix) Fix MCP: Silent failures make server integration opaque and hard to debug [4 comments, 5 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#49133Fetched 2026-04-17 08:49:57
View on GitHub
Comments
4
Participants
5
Timeline
7
Reactions
0
Author
Timeline (top)
commented ×4labeled ×3

MCP server failures are currently silent or cryptic, making it very hard to diagnose why a server isn't working. Several related pain points:


Error Message

Current behavior: If an MCP server is defined in ~/.claude/mcp/canny.json (a subdirectory) or .claude/settings.local.json, it is silently ignored. No error, no warning, no hint. The server simply doesn't appear. Expected behavior: Warn the user if a file that looks like an MCP config is found in a non-standard location, or at least document clearly which file locations are scanned. Current behavior: When a custom MCP server responds with an older protocolVersion (e.g. 2024-11-05) during the initialize handshake, Claude Code silently discards the response and waits ~30 seconds before timing out. No error is shown to the user. Expected behavior: Log a specific error like:

Root Cause

MCP server failures are currently silent or cryptic, making it very hard to diagnose why a server isn't working. Several related pain points:


Code Example

MCP server "canny" handshake failed: server returned protocolVersion "2024-11-05", expected "2025-11-25"

---

MCP servers: playwright ✓  canny  (handshake timeout — run with --mcp-debug for details)
RAW_BUFFERClick to expand / collapse

Summary

MCP server failures are currently silent or cryptic, making it very hard to diagnose why a server isn't working. Several related pain points:


Issues

1. Wrong config file location is silently ignored

Current behavior: If an MCP server is defined in ~/.claude/mcp/canny.json (a subdirectory) or .claude/settings.local.json, it is silently ignored. No error, no warning, no hint. The server simply doesn't appear.

Expected behavior: Warn the user if a file that looks like an MCP config is found in a non-standard location, or at least document clearly which file locations are scanned.


2. Protocol version mismatch causes a silent 30-second timeout

Current behavior: When a custom MCP server responds with an older protocolVersion (e.g. 2024-11-05) during the initialize handshake, Claude Code silently discards the response and waits ~30 seconds before timing out. No error is shown to the user.

Expected behavior: Log a specific error like:

MCP server "canny" handshake failed: server returned protocolVersion "2024-11-05", expected "2025-11-25"

This would have saved hours of debugging. The mismatch is easy to fix once you know it's the cause.


3. No visibility into MCP server startup or handshake

Current behavior: There is no way to see what happened during server startup — did the process launch? Did it crash? Did the handshake succeed or fail?

Expected behavior:

  • /mcp or a new /mcp logs command should show per-server status: starting, connected, failed (reason), timed out
  • Optionally: a --mcp-debug flag that streams server stderr and protocol messages to the terminal

4. --mcp-config failures are not surfaced

Current behavior: When --mcp-config <file> is passed and the server fails to start or handshake, there is no feedback. The tools just don't appear.

Expected behavior: On startup, print a summary of MCP servers loaded vs. failed, e.g.:

MCP servers: playwright ✓  canny ✗ (handshake timeout — run with --mcp-debug for details)

Impact

Users building or debugging custom MCP servers have no feedback loop. The combination of silent config location failures + silent protocol mismatches means a server can "fail" in two completely invisible ways before a single tool call is ever made.

Environment

  • Claude Code CLI
  • macOS (darwin 25.2.0)
  • Custom stdio MCP server (TypeScript/tsx)

extent analysis

TL;DR

To improve diagnostics for MCP server failures, implement explicit error logging and feedback mechanisms for config file location issues, protocol version mismatches, and server startup or handshake problems.

Guidance

  • Verify config file locations: Ensure that MCP server configurations are placed in standard, expected locations to avoid silent ignores.
  • Implement protocol version checks: Log specific errors when protocol version mismatches occur during the initialize handshake to facilitate easier debugging.
  • Enhance server startup visibility: Introduce a command or flag (e.g., /mcp or --mcp-debug) to provide real-time status updates on server startup, including success, failure, or timeout reasons.
  • Surface --mcp-config failures: On startup, print a summary of loaded versus failed MCP servers, including reasons for failures to improve the feedback loop.

Example

// Example of logging a protocol version mismatch error
if (serverProtocolVersion !== expectedProtocolVersion) {
  console.error(`MCP server handshake failed: server returned protocolVersion "${serverProtocolVersion}", expected "${expectedProtocolVersion}"`);
}

Notes

The provided guidance focuses on enhancing error logging and feedback to address the silent failure issues. Implementing these changes should significantly improve the diagnostics for MCP server failures. However, the exact implementation details may vary based on the specific requirements and constraints of the Claude Code CLI and custom MCP servers.

Recommendation

Apply the suggested workarounds and enhancements to improve error logging and feedback for MCP server failures, as there is no clear indication of a fixed version that addresses these issues. This approach will provide immediate benefits in terms of diagnostics and debugging capabilities.

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