Skip to content

[Feature Request] Auto-reconnect to MCP servers on connection loss #27528

@StephenHaney

Description

@StephenHaney

Bug Description
If Claude Code could automatically reconnect to MCP servers, it would help a lot when using http-transport for local desktop servers. Our server starts and ends when our desktop app is opened or closed. It creates a sequencing problem for users who leave Claude Open for long periods. They have to type /mcp and go to "reconnect" if they close our app and re-open it. We return a helpful error that tells Claude what's happening, but it doesn't have the ability to reconnect on its own.

For us, the easiest fix for this it to make our local http server a background service in the user's OS that fires up at startup, but I dislike when apps do this. We could also create a CLI-based MCP server that proxies to our app when it's open, but that has a new set of trade-offs.

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.1.50
  • Feedback ID: e043f13b-8e14-472b-b52d-7d19a1b245d1

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/stephen/.local/share/claude/versions/2.1.50 (expected in multi-process scenarios)\n    at OzR (/$bunfs/root/claude:2600:2098)\n    at SbA (/$bunfs/root/claude:2600:1209)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-21T22:26:48.175Z"},{"error":"McpError: MCP error -32001: AbortError: The operation was aborted.\n    at W (/$bunfs/root/claude:53:91496)\n    at <anonymous> (/$bunfs/root/claude:53:91754)\n    at abort (unknown)\n    at sv (/$bunfs/root/claude:11237:47951)\n    at <anonymous> (/$bunfs/root/claude:11229:6952)\n    at <anonymous> (/$bunfs/root/claude:441:6620)\n    at <anonymous> (/$bunfs/root/claude:262:2434)\n    at $ (/$bunfs/root/claude:262:3284)\n    at emit (/$bunfs/root/claude:250:529)\n    at OS0 (/$bunfs/root/claude:256:752)","timestamp":"2026-02-21T22:30:04.177Z"},{"error":"TelemetrySafeError: Invalid arguments for tool get_computed_styles: [\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"nodeIds\",\n      1\n    ],\n    \"message\": \"Invalid input: expected string, received number\"\n  }\n]\n\nTry once more, and if it still fails, ask the user to restart their MCP connection to get the latest tool definitions.\n    at We_ (/$bunfs/root/claude:1908:17301)\n    at async Qy7 (/$bunfs/root/claude:1908:14839)\n    at async call (/$bunfs/root/claude:1908:34003)\n    at async Qj7 (/$bunfs/root/claude:2006:15034)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-21T22:35:41.632Z"},{"error":"TelemetrySafeError: Invalid arguments for tool get_screenshot: [\n  {\n    \"code\": \"invalid_union\",\n    \"errors\": [\n      [\n        {\n          \"code\": \"invalid_value\",\n          \"values\": [\n            1\n          ],\n          \"path\": [],\n          \"message\": \"Invalid input: expected 1\"\n        }\n      ],\n      [\n        {\n          \"code\": \"invalid_value\",\n          \"values\": [\n            2\n          ],\n          \"path\": [],\n          \"message\": \"Invalid input: expected 2\"\n        }\n      ]\n    ],\n    \"path\": [\n      \"scale\"\n    ],\n    \"message\": \"Invalid input\"\n  }\n]\n\nTry once more, and if it still fails, ask the user to restart their MCP connection to get the latest tool definitions.\n    at We_ (/$bunfs/root/claude:1908:17301)\n    at async Qy7 (/$bunfs/root/claude:1908:14839)\n    at async call (/$bunfs/root/claude:1908:34003)\n    at async Qj7 (/$bunfs/root/claude:2006:15034)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-21T22:35:51.687Z"},{"error":"TelemetrySafeError: Invalid arguments for tool update_styles: [\n  {\n    \"expected\": \"record\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"updates\",\n      0,\n      \"styles\"\n    ],\n    \"message\": \"Invalid input: expected record, received undefined\"\n  }\n]\n\nTry once more, and if it still fails, ask the user to restart their MCP connection to get the latest tool definitions.\n    at We_ (/$bunfs/root/claude:1908:17301)\n    at async Qy7 (/$bunfs/root/claude:1908:14839)\n    at async call (/$bunfs/root/claude:1908:34003)\n    at async Qj7 (/$bunfs/root/claude:2006:15034)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-21T22:35:55.776Z"},{"error":"TelemetrySafeError: Invalid arguments for tool get_jsx: [\n  {\n    \"code\": \"invalid_value\",\n    \"values\": [\n      \"tailwind\",\n      \"inline-styles\"\n    ],\n    \"path\…

Note: Content was truncated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssue is inactive

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions