ANTIGRAVITY LABJP
Articles/Integrations
Integrations/2026-07-19Advanced

When an Unresponsive MCP Server Freezes Your Agent: Separate Timeouts for Connect, List, and Call

Antigravity CLI 1.1.3 closed the case where an unresponsive MCP server stalls an agent forever, by adding timeouts to connect, list-tools, and call-tool. This walks through why the three boundaries fail differently, and builds a defensive wrapper with a circuit breaker and failure-only notifications, backed by working code and a week of overnight runs.

Antigravity CLI15MCP18timeout6automation85design patternresilience8

Premium Article

The batch I run at 2 a.m. was only half done by morning. The last line in the log read "connected to MCP server," with no error and no exception after it. The connection had succeeded. The list-tools call I fired right after it simply never came back, and it waited that way until sunrise.

When you run several sites as an indie developer, this kind of "not even an error" stall is the worst kind. If something crashes, you can restart it. But a silent, endless wait gives you nothing to notice until you open the log the next day. This article starts from the path that Antigravity CLI 1.1.3 closed — an unresponsive MCP server stalling an agent forever — and turns it into a per-boundary timeout design you can drop around your own automation so it never dies in the same hole.

What 1.1.3 actually closed

The Antigravity CLI 1.1.3 release notes (2026-07-16) include one MCP-related fix. An MCP server that never returns a response used to stall the agent indefinitely; the fix resolves this by adding timeouts to each of connect, list-tools, and call-tool.

It looks minor, but if you run tasks unattended, it changes an assumption. Before, a single server that completed the handshake and then went silent could freeze the whole agent right there. With timeouts in place, at least the "wait forever" case is gone.

Still, the CLI no longer waiting internally does not make the outside of your own automation safe. If you invoke the CLI headless with agy -p and wrap it in cron or a shell, what happens after the CLI gives up is your design, not the CLI's. Skip that, and you trade one stall for another: "the CLI gave up at 120 seconds, but my script swallowed the failure and moved to the next job, leaving everything half-finished."

This piece is about not leaning entirely on the CLI's internal fix, and instead laying your own timeout layer around any automation that uses MCP. For the groundwork of running the CLI non-interactively, I covered that first in Running the Antigravity CLI Non-Interactively: Design Before You Put It on CI and Cron. Read together, they make it clearer whether the timeout should live on the inside (the CLI) or the outside (your operations).

Why one blanket timeout is not enough

It is tempting to write "time everything out at 60 seconds." That is exactly what I did first. But the three boundaries fail so differently that a single number is guaranteed to break one of them.

BoundaryTypical durationExample cause of a stallSafe to retry?
connecttens of ms to a few sprocess not started, port not listening, stalled TLS handshakeYes (no side effects)
list toolshundreds of mslock during init, infinite loop building the schemaYes (read only)
call toolhundreds of ms to tens of sslow external API, heavy input, waiting on a writeDepends (dangerous if not idempotent)

Allow 120 seconds for connect, and you wait two minutes on a server that failed to start. Give call-tool only 5 seconds, and you wrongly cut a tool that is legitimately doing heavy work. And only the call boundary ties its retry safety to the tool's idempotency. Re-issuing list-tools is a read, so it is carefree; blindly retrying a tool that writes can create a second problem, like a duplicate record.

So a timeout is not one number — it is a per-boundary budget. In my overnight batch I start from connect 15s, list-tools 20s, call-tool 120s. The split depends heavily on your environment, so I tighten it later against measurements.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Understand why connect, list-tools, and call-tool fail in different ways, so you can assign a separate timeout budget to each boundary instead of one blanket number
Stop a single unresponsive MCP server from wedging your whole overnight pipeline, using a defensive wrapper that combines timeouts, exponential backoff, and a circuit breaker
Add a failure-only notification that says which server stalled at which boundary, cutting the time you spend diagnosing it the next morning
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Integrations2026-07-18
Turning Silent Auto-Approvals into Allow Rules, One Soft-Deny at a Time
In Antigravity CLI 1.1.3, headless -p stops silently auto-approving confirmation-required tools and instead soft-denies them, printing the required allow-rule name to stderr. This piece uses that output as a discovery source to build least privilege from an empty allow set upward, with a working harness and real numbers from a personal automation.
Integrations2026-07-01
Distribution-Path-Agnostic Antigravity CLI Automation: Betting on Both the Consumer and Google Cloud Editions
The 7/1 announcement began offering the Antigravity CLI via the Gemini Enterprise Agent Platform too. Here is a design that abstracts your personal automation to run on either the consumer or Cloud edition, laid out with a wrapper and capability-detection scripts.
Integrations2026-06-19
Running Antigravity CLI Unattended: Notify Only on Real Failures
A small wrapper for scheduled Antigravity CLI runs that stays silent on success and alerts you only on failures a human needs to act on, covering exit codes, transient-error triage, and duplicate suppression.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →