[BUG] Critical Bug: Claude Code Drops HTTP-Based MCP Tool Connections Mid-Session — Breaks Agent Access Despite Active Servers

Resolved 💬 6 comments Opened Jul 28, 2025 by vanman2024 Closed Jan 3, 2026

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [x] Other: Claude Code (local CLI with MCP streamable HTTP transport)
  • Claude CLI version: @anthropic-ai/claude-code@latest (installed July 28, 2025)
  • Operating System: Linux 5.15.167.4-microsoft-standard-WSL2 (running under Windows 11 / WSL2)
  • Terminal: VS Code integrated terminal

---

Bug Description

Claude Code sessions are repeatedly dropping connections to MCP tools running over HTTP (streamable transport). This issue prevents AI agents from interacting with essential tool interfaces, even though the MCP servers remain active, listening, and functional.

The system initially connects successfully when the session starts, and all tools show as available. But within 5–10 minutes of use or brief inactivity, Claude Code can no longer detect or communicate with any MCP HTTP tools. This breaks all downstream agent workflows, rendering tool-based tasks non-functional unless the session is manually restarted.

This behavior did not occur in previous builds. Once connections were established, they typically remained stable unless a rare disconnection occurred, but even then, tools did not require frequent restarts. The regression is recent and severely impacting daily development.

---

Steps to Reproduce

  1. Start MCP HTTP servers (confirmed active, listening on expected ports)
  2. Launch Claude Code and verify all MCP tools connect (initial state: working)
  3. Begin development — agents successfully use HTTP-based tools initially
  4. After 5–10 minutes (idle or active):
  • MCP tool access breaks silently
  • Agent tool calls timeout or fail
  • Claude Code no longer lists any connected tools
  1. Manually restart Claude Code session
  2. Issue repeats consistently across all sessions

---

Expected Behaviour

  • Claude Code should maintain persistent connections to MCP servers over HTTP
  • Agents should have uninterrupted access to tools throughout the session
  • No manual session restarts or server refreshes should be required
  • Behavior should be consistent with prior functionality

---

Actual Behavior

  • Claude Code drops all MCP tool connections mid-session
  • Servers remain running and reachable directly via port
  • Agents fail silently or throw tool-access errors
  • Manual session restart is the only workaround
  • Issue recurs every 5–10 minutes and affects all HTTP-based MCP tools

---

Additional Context

  • Only affects streamable transport over HTTP (MCP servers using TCP/WS or persistent sockets not tested here)
  • Issue affects multiple MCP servers:

``
8006: filesystem_server.py
8007: memory_server.py
8011: github_server.py
8013: supabase_server_v4.py
8015: vercel_v0_server.py
8016: figma_application_server.py
8020: sequential_thinking_server.py
8035: claude_code_server.py
8042: docker_server.py
``

  • All ports show as actively listening:

``bash
netstat -tuln | grep LISTEN | grep -E ":(80[0-9][0-9])"
``

  • Development environment includes multiple VS Code terminals, active Next.js dev server (port 3001), and several Puppeteer-driven tools
  • Regression began around July 27–28, 2025

---

Hypothesized Root Causes

  • Claude Code may not be retaining persistent HTTP sessions (keep-alive failure)
  • Lack of reconnection or heartbeat logic for dropped HTTP tool sessions
  • Possible session state loss in Claude Code context manager
  • Race conditions when handling tool call concurrency or idle cleanup

---

Severity

  • Impact: High — blocks agentic workflows entirely
  • Frequency: Every session (persistent and reproducible)
  • Workaround: Manual session restart (temporary only; interrupts continuity)

---

Let me know if you’d like this exported to PDF, saved to a file, or submitted via a CLI bug reporting script.

View original on GitHub ↗

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