Skip to content

Instantly share code, notes, and snippets.

View romanilyin's full-sized avatar

Roman «Stinger» Ilyin romanilyin

View GitHub Profile
@romanilyin
romanilyin / antigravity_win11_error.md
Last active November 28, 2025 14:51
Issue with Google Antigravity + MCP "invalid trailing data at the end of stream"

Issue with Google Antigravity + MCP "invalid trailing data at the end of stream"

Root Cause

The error "invalid trailing data at the end of stream" during MCP initialization in Google Antigravity (unlike in Cursor and other tools) is related to differences in handling line breaks on Windows.

The problem is as follows:

  • On Windows, standard line break characters use CRLF (\r\n) instead of LF (\n).
  • When sending JSON-RPC messages via stdin/stdout, Google Antigravity validates the protocol format more strictly.
  • The \r (carriage return) character from the \r\n pair is interpreted as "trailing data" — a legal end of the message, but unexpectedly followed by extra characters[3].