Problem Description
When starting Antigravity 2.0, several MCP servers, such as SonarQube and Sequential Thinking, fail to initialize correctly.
The client then aborts the connection and returns the terminal error: Error: context deadline exceeded.
At the same time, lightweight or purely local MCP servers, such as context7, sometimes connect without issues.
Notably, the same failing MCP servers work correctly inside the Antigravity IDE.
Technical Root Cause Analysis
A likely root cause is that some MCP servers report themselves as ready before their background initialization has actually finished.
The SonarQube logs strongly suggest this behavior.
INFO SonarQube MCP Server Backend service initialized.
INFO SonarQube MCP Server - Status: Server ready - tools loading in background
INFO SonarQube MCP Server - Waiting for background initialization to complete before shutdown… : context deadline exceeded
These logs indicate that the server becomes nominally available but still blocks while completing background startup work.
During that phase, it may still be resolving analyzers, fetching configuration, or establishing a secure connection to SonarCloud.
If the client requests the initial tool list during this window, the server may not respond quickly enough.
As a result, the handshake or tool discovery phase times out.
A second contributing factor appears to be the strict timeout behavior in the Antigravity 2.0 CLI.
The CLI seems to enforce a short, hard-coded timeout, roughly in the 5 to 10 second range, for the initial handshake and tool discovery process.
That is often not enough for remote or heavy MCP servers on a cold start, especially when they need to verify tokens, fetch remote state, or complete additional setup.
Unlike the IDE, the new Antigravity 2.0 launches these MCP servers from scratch for the active session, which makes initialization delays much more visible and much more likely to hit the timeout limit.
Moreover, it takes a considerable amount of time to initiate MCPs. This is because you have to reload several times before you see any MCPs starting.
Why It Works in the Antigravity IDE
The Antigravity IDE appears to manage the MCP server lifecycle differently from the new one.
Most importantly, it seems to tolerate longer initialization times and avoids blocking its main execution path in the same way.
It may also keep MCP server processes alive in the background, so once a server has completed its startup sequence, later requests no longer need to repeat the full handshake.
That would explain why the same servers work reliably in the IDE but fail in the CLI.
Proposed Solutions and Workarounds
One improvement would be to make the MCP handshake timeout configurable, for example, through an option or environment variable such as ANTIGRAVITY_MCP_TIMEOUT_MS.
That would allow users to increase the timeout for slower or network-dependent servers.
Another improvement would be asynchronous or lazy tool discovery.
In that model, MCP servers could return immediately with an empty or partial tool list, then publish the full set of tools once background initialization is complete.
This would prevent long startup work from blocking the initial connection.
A third option would be a warm-start daemon for the tool.
If the Antigravity 2.0 could keep MCP server processes alive across commands, it would avoid repeated cold starts and significantly reduce timeout-related failures.