Skip to content

Feature Request: Auto-reconnect for MCP servers when disconnected #15904

@nikhilchowdhury-nixet

Description

@nikhilchowdhury-nixet

Problem

MCP servers disconnect intermittently during sessions (every few runs/commands). Currently, the only way to reconnect is manually running /mcp, which interrupts workflow.

Current Behavior

  • MCP servers disconnect without warning during active sessions
  • No automatic reconnection attempt is made
  • User must manually run /mcp to reconnect
  • This is disruptive when relying on MCP tools (postgres, github, etc.)

Desired Behavior

  1. Auto-reconnect: When an MCP server disconnects, Claude Code should automatically attempt to reconnect
  2. Configurable retry: Allow configuration for:
    • Number of retry attempts
    • Retry interval/backoff
    • Whether to notify user on reconnect
  3. Graceful degradation: Only stop attempting reconnection if:
    • User explicitly disables the server
    • Max retries exceeded (with user notification)
    • Server is explicitly removed from config

Proposed Configuration

{
  "mcpServers": {
    "postgres": {
      "command": "...",
      "autoReconnect": true,
      "maxRetries": 5,
      "retryIntervalMs": 3000
    }
  }
}

Impact

This would significantly improve the experience for users who rely on MCP servers for database access, GitHub integration, and other tools during development sessions.

Environment

  • OS: Windows (MINGW64)
  • Claude Code: Latest version

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcpautocloseIssue will be closed automaticallyenhancementNew feature or requestplatform:windowsIssue specifically occurs on Windows

    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