Cost me some Aragon’s tokens to repaid what Antigravity broke but it works
Title
MCP Remote Streamable HTTP / OAuth Token Binding Broken in v2.26.0 (Hangs Indefinitely on Startup)
Post Body
Description:
In the latest Antigravity update (v2.26.0), remote MCP servers configured via Streamable HTTP with OAuth authentication fail to connect. The language server hangs in the connecting state indefinitely, causing the entire mcp_servers section and its tools to be dropped from the session.
Steps to Reproduce:
-
Configure a remote authenticated MCP server in ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"my-server": {
"url": "https://<host>/mcp"
}
}
}
-
Have valid credentials already present in ~/.gemini/antigravity/mcp_oauth_tokens.json.
-
Launch Antigravity v2.26.0.
Observed Behavior:
- The language server fails to send the stored bearer token during the
initialize handshake.
- The remote server responds with
HTTP 401 Unauthorized.
- Instead of triggering an OAuth refresh or prompting for sign-in,
language_server.exe hangs indefinitely.
- The agent drops all tools from the server.
- Adding custom
"headers" to mcp_config.json is also ignored by the HTTP transport.
Logs (%APPDATA%\Antigravity\logs\language_server.log):
mcp_manager.go:1008] MCP: 1 server(s) still connecting after 30s: <server-id>
mcp_manager.go:1008] MCP: 1 server(s) still connecting after 1m0s: <server-id>
...
declarative_config_loader.go:280] skipping component during resolution: empty component: prompt section "mcp_servers"
Expected Behavior:
The language server should attach the stored OAuth bearer token from mcp_oauth_tokens.json to the Streamable HTTP request, refresh the token via /oauth/token if an expired 401 is received, or respect custom headers configured in mcp_config.json.
Workaround for Affected Users:
Until fixed, wrap the remote MCP server in a local stdio bridge (e.g. in Python) that reads the token from mcp_oauth_tokens.json and forwards JSON-RPC via HTTPS, then configure the server under mcp_config.json with "command": "python".
Hi @Wojtek_Kalka,
Could you please share the reproduction steps to reproduce this issue?
Hi @Ambati_Rajendra,
Here are the exact reproduction steps, including how to reproduce it with any generic authenticated endpoint:
Reproduction Steps
-
Prerequisite: A remote MCP server running over Streamable HTTP (or any HTTP endpoint) that requires Authorization: Bearer <token> on all requests, returning 401 Unauthorized when called without a bearer token.
-
Store a valid token in ~/.gemini/antigravity/mcp_oauth_tokens.json (as created by the OAuth flow):
{
"https://<your-mcp-host>/mcp": {
"client_id": "<client_id>",
"token": {
"access_token": "<valid_access_token>",
"token_type": "Bearer",
"refresh_token": "<valid_refresh_token>",
"expiry": "2026-10-26T18:00:00Z"
},
"token_url": "https://<your-mcp-host>/oauth/token"
}
}
-
Configure the server in ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"my-remote-server": {
"url": "https://<your-mcp-host>/mcp"
}
}
}
(Note: Tested with both "url" and legacy "serverUrl").
-
Start or restart Antigravity v2.26.0.
-
Observe the behavior:
-
The agent never receives the tools exposed by my-remote-server.
-
Inspection of network traffic shows language_server.exe sends the initial initialize POST without the Authorization: Bearer <token> header, despite valid tokens existing in mcp_oauth_tokens.json.
-
The endpoint responds with HTTP 401 Unauthorized.
-
language_server.exe does not attempt an OAuth refresh, does not trigger a sign-in flow, and never times out or fails fast. Instead, it enters an infinite pending loop.
-
In %APPDATA%\Antigravity\logs\language_server.log, you will see:
mcp_manager.go:1008] MCP: 1 server(s) still connecting after 30s: my-remote-server
mcp_manager.go:1008] MCP: 1 server(s) still connecting after 1m0s: my-remote-server
mcp_manager.go:1008] MCP: 1 server(s) still connecting after 4m0s: my-remote-server
...
declarative_config_loader.go:280] skipping component during resolution: empty component: prompt section "mcp_servers"
-
Alternative attempted workaround: Attempting to supply "headers": { "Authorization": "Bearer <token>" } inside mcp_config.json is also completely ignored by the Go client in language_server.exe.
The only working temporary bypass is wrapping the remote HTTP call in a local stdio executable/script that attaches the header and passes standard input/output.