Skip to content

Malformed MCP response drops stdio transport instead of quarantining the server #50095

Closed as not planned

Description

@thhart

Environment

  • Claude Code 2.1.112
  • macOS 26.4 (Darwin 25.4.0), arm64
  • stdio MCP transport bridging to SSE (Spring AI MCP server)

Symptom

Adding a misbehaving MCP server to ~/.claude.json prevents new Claude Code from starting cleanly — it presents to the user as a "crash" at startup. Removing the offending entry restores startup. Claude code is crashing hard!!!

Repro

Configure any MCP server whose stdio stream delivers a JSON-RPC response whose id the client did not issue (or a duplicate response for an already-consumed id — same effect).

From ~/Library/Caches/claude-cli-nodejs/<cwd>/mcp-logs-<name>/*.jsonl:

{"debug":"Starting connection with timeout of 30000ms"}
{"debug":"Successfully connected (transport: stdio) in 176ms"}
{"debug":"Connection established with capabilities: {\"hasTools\":true,...}"}
{"debug":"STDIO connection dropped after 0s uptime"}
{"debug":"Connection error: Received a response for an unknown message ID: {\"jsonrpc\":\"2.0\",\"id\":4,\"result\":{\"resourceTemplates\":[]}}"}
{"debug":"Closing transport (stdio transport error: Error)"}

In my case the root cause was a server-side bug (Spring AI MCP re-emitting the last response on concurrent POST batches as a duplicate SSE event), but the point is that any protocol-level violation from one MCP server should not degrade Claude Code startup — it should be isolated.

Expected

A protocol violation from one MCP server should:

  • log the violation (already happens)
  • mark that server's tools/prompts/resources unavailable for the session
  • leave the rest of the Claude Code session fully functional at startup

Observed

Startup experience degrades to the point the user reports it as a "crash" until the offending server is removed from ~/.claude.json.

Suggested fix

In the stdio MCP client, on "unknown message ID" or similar protocol errors: isolate the failure to that one transport, continue startup for everything else, and surface the failure via /mcp rather than letting it propagate into the startup path.

Activity

  1. added
    bug
    platform:macos
    on Apr 17, 2026
  2. added
    stale
    on May 11, 2026
  3. github-actions commented on May 25, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  4. github-actions commented on Jul 20, 2026

    @github-actions

    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.

  5. locked as resolved and limited conversation to collaborators on Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcpbugplatform:macosstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions