Antigravity
Install context-mode in the Antigravity IDE as an MCP-only host: register an MCP server with npx and let a GEMINI.md routing file steer data-heavy output into the sandbox.
Antigravity is Google's AI-powered IDE, a Gemini fork built on Electron and
VSCode. It integrates context-mode as an MCP-only host — Antigravity exposes no
hook surface, so routing is steered by an instruction file the host reads
natively. The ctx_* tools are always available; the host decides whether to
send data-heavy output through them.
As an MCP-only host, large-output routing is advisory rather than a hard intercept. The agent follows the instruction file most of the time — roughly 60% adherence — but is not forced to, so savings vary by session.
Install
Antigravity has no plugin marketplace, so context-mode runs as an MCP server.
Launching it with npx means no global install is required.
Register the MCP server
Add an MCP server entry to the Antigravity MCP config. Antigravity shares the
~/.gemini/ directory with Gemini CLI but reads MCP servers from a separate
file: ~/.gemini/antigravity/mcp_config.json. If you installed context-mode
globally with npm install -g context-mode, point the server at the
context-mode binary:
{
"mcpServers": {
"context-mode": {
"command": "context-mode"
}
}
}If you would rather not install globally, launch it with npx instead by
setting "command": "npx" and "args": ["-y", "context-mode"]. Either path
needs Node 22.5+ or Bun available on your PATH. context-mode detects
Antigravity from the MCP client handshake (clientInfo.name reports
antigravity-client); if detection is ever ambiguous, set
CONTEXT_MODE_PLATFORM=antigravity in the server env to force it.
Confirm the routing instruction file
On first server startup context-mode writes a GEMINI.md routing file at your
project root, which Antigravity reads natively. It tells the agent to send
data-heavy output through the ctx_* tools. You do not need to create it by
hand. Because Antigravity shares ~/.gemini/ with Gemini CLI, session data lives
under ~/.gemini/context-mode/sessions/, where each session DB file is prefixed
by a project hash so different projects never collide. For the exact path
derivation and the file contents, see configuration.
What you get on this host
The ctx_* tools are fully available: the agent can run code with ctx_execute,
search prior results with ctx_search, and index content with ctx_index. What
differs from a hooked host is enforcement. On a hooked host the routing of large
output is mandatory; here it is advisory, carried by the GEMINI.md file the
host reads. See tool selection for how the agent
decides which tool to reach for.
Verify
Confirm the install with the doctor. It checks language runtimes, the FTS5
knowledge base, and MCP server registration, then reports anything that needs
attention. Since the npx path installs no global binary, run the doctor with
npx too:
npx -y context-mode doctorIf you ran npm install -g context-mode, context-mode doctor works as well.
A clean run means the MCP server is reachable and the routing file is in place.
Related
Pi
Install context-mode in the Pi Coding Agent as a package extension with full hook support and an MCP server, providing high session continuity.
Antigravity CLI
Install context-mode in Antigravity CLI (agy) with one plugin command — it registers the MCP server, a routing rule, a routing skill, and bounded JSON hooks.