Double-Esc and `/mcp` hang when an MCP server connects to a filtered port

Resolved 💬 5 comments Opened Apr 26, 2026 by flound1129 Closed May 31, 2026

Summary

If a configured MCP server points at a host:port that is filtered (packets silently dropped, e.g. by a firewall), Claude Code blocks on the connection attempt instead of timing out. While in this state:

  • Pressing Esc-Esc to open the message history hangs (no UI response).
  • Running /mcp hangs (the MCP status dialog never renders).

The CLI otherwise appears responsive until you trigger one of these paths.

Repro

  1. Configure an MCP server (stdio or SSE) whose endpoint resolves to a filtered port — e.g. an SSE URL on a host where the port is dropped by a firewall, so the TCP SYN gets no response.
  2. Start Claude Code so it begins connecting to that server.
  3. While the connection is still pending, press Esc twice, or run /mcp.
  4. Observe: both actions hang indefinitely.

Expected

Esc-Esc and /mcp should remain responsive regardless of MCP connection state. MCP connections should have a bounded timeout so a filtered port surfaces as a connection error rather than an indefinite hang.

Environment

  • Claude Code (latest)
  • macOS (Darwin 25.3.0)

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗