[BUG] MCP proxy silently hangs on tool_use results — Claude CLI blocks waiting for complete tool_result set

Open 💬 3 comments Opened Mar 24, 2026 by pdazero

Bug description

When using claude -p (headless mode) with claude.ai MCP servers, the Anthropic MCP proxy silently drops tool results. The upstream MCP server (Bear Notes) responds successfully (HTTP 200, ~44ms), but the proxy never delivers the result back to Claude CLI. Since Claude CLI requires the complete set of tool_results before continuing, this causes it to block indefinitely until the inactivity timeout fires.

Environment

  • Claude CLI: 2.1.78, 2.1.79, 2.1.80
  • OS: macOS 15 (Apple Silicon)
  • MCP servers: claude_ai_bear (Bear Notes)
  • Invocation: claude -p --output-format stream-json --allowedTools "mcp__claude_ai_bear__*"

Steps to reproduce

  1. Use claude -p with claude.ai Bear Notes MCP tools enabled
  2. Send a prompt that triggers multiple parallel get_note calls
  3. One call returns successfully, the other never arrives from the proxy
  4. Claude CLI blocks indefinitely waiting for the complete tool_result set

Consistently reproducible with specific notes — the same note always hangs through the proxy while the upstream Bear server responds normally.

Observed behavior

  • Bear Notes MCP server responds HTTP 200 in ~44ms (server is healthy)
  • Proxy receives the response but never forwards it to Claude CLI
  • Claude CLI cannot proceed — it requires all pending tool_result messages
  • Inactivity timeout eventually fires (no error, silent failure)
  • Fallback retry hits the same hung call → same result
  • Total pipeline timeout → failure

Key observation: This is a proxy-layer issue. The upstream server is healthy — the proxy silently drops the response.

Expected behavior

Any of:

  1. Proxy delivers all results reliably
  2. Per-tool timeout with a clear error message (e.g., tool_result timeout for tool_use_id X)
  3. Claude CLI can continue with partial results when some tool_results are missing

Workarounds

We implemented the following workarounds in our automation pipeline:

  • Track pending tool_use IDs via stream-json output to identify which call hung
  • Adaptive inactivity timeout (2x when tool_use is pending)
  • On MCP hang detection: fallback with restricted tools (write-only Bear tools, disabling get_note/search_notes)
  • Minimum remaining timeout check before fallback attempt

Related issues

  • #18745 — MCP servers failing causing Claude CLI to hang with stalled token usage
  • #15945 — MCP Server causes 16+ hour hang, no timeout or stuck detection
  • #36469 — Claude Code hangs indefinitely on large MCP tool responses
  • #15758 — MCP tools silently disappear mid-session
  • #22451 — MCP Tools hanging for 5-10 minutes then failing

View original on GitHub ↗

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