Skip to content

MCP Status: No live updates when MCP servers connect/disconnect #228

@ali-nr

Description

@ali-nr

Problem

The MCP status component doesn't update in real-time when MCP servers connect or disconnect. Users must restart Claude Code to see updated status.

Current Behavior

  • MCP status is cached for 5 minutes (CACHE_DURATION_MEDIUM)
  • Running /mcp to reconnect a server doesn't update the statusline
  • Only way to see updated status is to restart Claude Code or wait for cache expiry

Root Cause

  • No event-based mechanism to detect MCP state changes
  • The statusline polls on a timer, not on MCP events
  • Cache invalidation only happens on timeout, not on MCP operations

Proposed Solution

  1. Reduced Cache Duration: Reduce MCP cache to 30 seconds for more responsive updates
  2. Cache Invalidation Signal: Add mechanism for external tools to signal cache refresh

Files Affected

  • lib/mcp.sh - cache duration settings
  • lib/cache/operations.sh - cache invalidation mechanism

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions