A JetBrains plugin that bridges the Antigravity CLI
(agy) with JetBrains IDEs (IntelliJ IDEA, PhpStorm, WebStorm, PyCharm, GoLand,
and other IntelliJ-based IDEs) so the agent can see your active file, selection,
open tabs, and inspection diagnostics on demand.
The plugin exposes four MCP tools to agy:
| Tool | What it returns |
|---|---|
ide_get_active_editor |
File path, language, cursor (1-based), selection range and text, full file content |
ide_get_open_files |
Absolute paths of every file currently open in an editor tab |
ide_get_diagnostics |
Inspections, syntax errors, and warnings for a file (or the active editor) |
ide_open_file |
Open a file at an optional line/column |
When you click the Open Antigravity CLI toolbar button, agy launches in
an IDE-embedded terminal already wired to the current project — no manual
configuration steps. By default the button focuses the existing Antigravity
terminal tab if one is open; toggle Always open a new tab in settings to
spawn a fresh session on every click.
- A JetBrains IDE built on IntelliJ Platform 232+ (PhpStorm, IntelliJ IDEA, WebStorm, GoLand, RustRover, … — anything from 2023.2 through the current release).
- The Antigravity CLI installed locally. The plugin will look for
agy(oragy.exeon Windows) on$PATH, then in~/.local/bin,/opt/homebrew/bin, and/usr/local/bin. You can override the location in the plugin settings. - macOS, Linux, or Windows. The plugin's stdio bridge uses the IDE's bundled
JBR (Java) — no external tools like
ncare required.
- Grab or build an
antigravity-companion-<version>.zip(see Building from source if you don't have one). - In the IDE: Settings → Plugins → ⚙ → Install Plugin from Disk…
- Pick the ZIP and restart when prompted.
See Building from source.
Open Settings → Tools → Antigravity Companion.
- Path to agy executable — absolute path to the
agybinary the plugin should launch. Leave blank to auto-detect ($PATH+ common install dirs). The settings panel tells you which path it currently resolves to. - Always open a new tab — when off (default), clicking the toolbar focuses
the existing Antigravity terminal tab if one is open; when on, every click
spawns a fresh
agysession. - Keyboard shortcut — no shortcut is bound by default (no chord is safe
across every bundled keymap). Click Configure shortcut in Keymap settings…
in the panel, or open Settings → Keymap directly and search for
Open Antigravity CLI, to assign one. Multiple parallel
agysessions are still supported regardless of how the action is triggered.
No other configuration is required. The plugin manages
~/.gemini/config/mcp_config.json on its own and cleans up after itself when
projects close.
- Open a project and the file you want
agyto see. - Click the lightning ⚡ toolbar button (top-right) or invoke
Open Antigravity CLI from Find Action (
⇧⌘A/Ctrl+Shift+A). - A terminal tab opens with
agyrunning. Ask it about your code — when it needs context it will call the plugin's MCP tools transparently.
A useful first prompt: "What file am I looking at? Use ide_get_active_editor."
agy reads MCP server definitions from ~/.gemini/config/mcp_config.json. On
project open the plugin:
- Starts a small JSON-RPC server on
127.0.0.1:<random>(line-delimited MCP over a plain TCP socket). - Writes a per-project bridge script —
jetbrains-mcp-bridge-<productCode>-<projectHash>.shon Unix or.baton Windows — under~/.gemini/antigravity-cli/.<productCode>is the JetBrains IDE code (iu,ps,ws,py,go, …) so two IDEs opening the same project don't collide. The script uses the IDE's bundled JBR to run a tiny pure-Java stdio↔TCP relay, soagy(which speaks stdio MCP) can reach the in-IDE TCP server with no external dependencies. - Merges its entry into
mcp_config.jsonundermcpServers.jetbrains-companion-<productCode>-<projectHash>(preserving any other entries).
On project close it removes the config entry and deletes the bridge script.
┌────────────────────┐ stdio ┌──────────────────┐ TCP ┌─────────────────┐
│ agy CLI (terminal) │ ─────────► │ bridge script │ ───────► │ Plugin MCP svr │
│ │ ◄───────── │ (JBR StdioBridge)│ ◄─────── │ (in JetBrains) │
└────────────────────┘ └──────────────────┘ └─────────────────┘
| Path | Purpose |
|---|---|
~/.gemini/config/mcp_config.json |
The plugin merges/removes its jetbrains-companion-<productCode>-<projectHash> entry here. Other entries are preserved. On register, the plugin also removes any legacy keys for this project's projectHash (e.g. phpstorm-companion-<projectHash>) left behind by older plugin versions; legacy entries belonging to other projects are not touched. |
~/.gemini/antigravity-cli/jetbrains-mcp-bridge-<productCode>-<projectHash>.{sh,bat} |
Auto-generated bridge script; deleted on project close. Do not edit by hand. |
~/.gemini/antigravity-cli/cli.log (symlink to latest run) |
agy's log — useful when MCP traffic looks wrong. |
IDE idea.log |
Plugin logs. Look for AntigravityCompanionService: MCP server listening on 127.0.0.1:<port>, MCP client connected from …. |
The "Open Antigravity CLI" button shows a notification "agy executable
not found".
Open Settings → Tools → Antigravity Companion and set the path explicitly,
or install agy to one of the auto-detected locations.
agy answers "I don't have visibility into your IDE".
The plugin probably isn't registered. Check:
- Settings → Plugins — make sure the plugin is enabled.
idea.logforMCP server listening on 127.0.0.1:<port>.~/.gemini/config/mcp_config.jsoncontains ajetbrains-companion-*entry.
agy log shows Connection refused or socket errors on startup.
The IDE (or that project) closed while agy was still running. Quit agy and
relaunch it from the toolbar button — the plugin re-registers a fresh port
each time a project opens.
mcp_config.json is corrupted.
Delete it; the plugin will recreate it on the next project open.
- Git
- JDK 17 (Temurin, Zulu, or the IDE's bundled JBR all work).
JAVA_HOMEmust point at it. - Internet access on first build — the IntelliJ Gradle plugin downloads a
sandboxed IDE matching
platformVersioningradle.properties.
git clone https://github.com/matasarei/antigravity-companion.git
cd antigravity-companion
./gradlew buildPluginThe signed (unsigned in dev) plugin archive will be at:
build/distributions/antigravity-companion-<version>.zip
Install it via Settings → Plugins → ⚙ → Install Plugin from Disk….
./gradlew runIde # launch a sandbox IDE with the plugin pre-loaded
./gradlew verifyPlugin # IntelliJ Plugin Verifier — static checks
./gradlew clean buildPlugin # full rebuild./gradlew runIde is the fastest dev loop: it starts a fresh sandbox IDE,
side-loads the plugin, and tears down on exit. Edit code, rerun, repeat.
src/main/
├── java/dev/matasar/antigravity/bridge/
│ └── StdioBridge.java ← pure-Java stdio↔TCP relay
└── kotlin/dev/matasar/antigravity/
├── action/StartSessionAction.kt ← toolbar button
├── service/AntigravityCompanionService.kt ← MCP server + tool impls
├── settings/AntigravitySettings.kt ← persistent state
├── settings/AntigravitySettingsConfigurable.kt ← Settings panel
└── startup/AntigravityStartupActivity.kt ← eager-init on project open
src/main/resources/
├── META-INF/plugin.xml ← plugin manifest
└── icons/ ← toolbar / plugin icons
build.gradle.kts, gradle.properties, settings.gradle.kts
- WSL2 on Windows. When running the JetBrains IDE natively on Windows but working on a project located in a WSL2 path (
\\wsl.localhost\<distro>\...), the plugin cannot spawn a Linuxagybinary directly. The only supported workaround is to run the JetBrains IDE itself inside WSL2 (e.g. using JetBrains Gateway or WSLg) and install the plugin andagyinside WSL. - Pull-based only. The IDE does not push selection changes to
agymid-conversation;agycalls back over MCP when it decides it needs IDE state. - Multi-project. Each open project registers a separate
jetbrains-companion-<productCode>-<projectHash>entry. A runningagyin workspace A will also see workspace B's tools in its catalog; only the live project's bridge succeeds, but the duplicate tool names can confuse the model.
MIT — see LICENSE.