Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

MCP Connection Health Monitoring #6

@avrabe

Description

@avrabe

Epic: MCP Integration

Priority: Critical
Story Points: 5
Phase: 1

Problem

The MCP client has connection monitoring infrastructure but the UI doesn't display connection status or handle connection failures gracefully.

Solution

Implement connection health monitoring UI and automatic reconnection handling.

Implementation Details

Ready-to-use code in src/mcp/client.ts:

  • addConnectionListener() - Register connection status handlers (lines 167-169)
  • isConnected() - Check current connection status (lines 186-188)
  • scheduleReconnect() - Automatic reconnection with exponential backoff (lines 319-340)
  • startPing() - Keep-alive ping mechanism (lines 342-356)

Tasks

  • Add connection status indicator to UI header
  • Show reconnection progress during connection failures
  • Display connection quality metrics (ping time, reconnect attempts)
  • Implement offline mode with queued operations
  • Add manual reconnect button for user control

UI Components Needed

// Connection status indicator
<ConnectionStatusIndicator 
    connected={mcpClient.isConnected()}
    reconnectAttempts={reconnectAttempts}
    lastPingTime={lastPingTime}
/>

// Connection listener
mcpClient.addConnectionListener((connected) => {
    setConnectionStatus(connected);
    if (\!connected) {
        showReconnectionProgress();
    }
});

Acceptance Criteria

  • Connection status is visible to users at all times
  • Reconnection attempts are shown with progress indication
  • Users can manually trigger reconnection
  • Operations are queued during disconnection
  • Connection metrics help with debugging

Technical Notes

  • Uses exponential backoff for reconnection (1s, 2s, 4s, 8s, 16s, 30s max)
  • Ping every 30 seconds maintains connection
  • Max 5 reconnection attempts before giving up
  • Session ID preserved across reconnections

Files:

  • src/mcp/client.ts:167-188 (connection monitoring)
  • src/mcp/client.ts:319-356 (reconnection logic)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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