Skip to main content
Glama
Antigravity MCP Bridge

Antigravity MCP Bridge

by Zythenth

Black Gravity animated logo

🌍 English / Português

MIT License Minimum Node.js version CI

Black Gravity

Black Gravity is a local MCP server that delegates programming tasks to Google Antigravity through its official agy CLI. It gives Codex tools to start tasks in isolated project copies, follow their progress, and review the results before applying changes. Black Gravity is independent of Google and OpenAI.

Installation

Use one registration method per harness to avoid duplicate tools. Commands run from the repository root. A harness is Supported when its own command registered the build in this repository and listed it, without calling a model, or when the maintainer confirmed it working with the configuration shown. Anything else is marked Not verified.

Harness

Status

What was checked

Codex plugin

Supported

Listed by codex plugin list and codex mcp list (Codex CLI 0.163.0, Windows)

Codex, MCP only

Supported

Listed by codex mcp list (same version)

Claude Code, MCP only

Supported

Shown as Connected by claude mcp list (Claude Code 2.1.319, Windows)

Claude Code plugin with skill

Planned

Not available yet

Claude Desktop

Supported

Confirmed by the maintainer with the configuration below

OpenCode

Supported

Confirmed by the maintainer with the configuration below

agy

Not verified

agy mcp list exists, but agy has no documented way to isolate its configuration

Other MCP clients (stdio)

Partial

The server answered initialize and tools/list with 50 tools; no other client was tested

Linux commands

Supported

Listed by codex mcp list (Codex CLI 0.171.0) and shown as Connected by claude mcp list (Claude Code 2.1.326, run by its absolute path), Ubuntu 26.04

macOS commands

Not verified

No test machine

Codex plugin

Supported. Run these commands with the Codex CLI, then open a new conversation.

codex plugin marketplace add Zythenth/black-gravity
codex plugin add black-gravity@black-gravity

Codex, MCP only

Supported.

$server = (Resolve-Path .\plugin\server.mjs).Path
codex mcp add black-gravity -- node $server
codex mcp list

Claude Code, MCP only

Supported.

$server = (Resolve-Path .\plugin\server.mjs).Path
claude mcp add --scope user black-gravity -- node $server
claude mcp list

Claude Code plugin with skill

Planned. There is no plugin for Claude Code yet. Use the MCP-only registration above.

Claude Desktop

Supported. Add the server to claude_desktop_config.json with the absolute path to plugin/server.mjs, then restart the app. The file is in %APPDATA%\Claude on Windows and in ~/Library/Application Support/Claude on macOS; Settings > Developer > Edit Config opens it.

{
  "mcpServers": {
    "black-gravity": {
      "command": "node",
      "args": ["<absolute path to plugin/server.mjs>"]
    }
  }
}

OpenCode

Supported. Add the server under mcp in opencode.json, either in the project root or in ~/.config/opencode/opencode.json for every project, with the absolute path to plugin/server.mjs, then restart OpenCode.

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "black-gravity": {
      "type": "local",
      "command": ["node", "<absolute path to plugin/server.mjs>"],
      "enabled": true
    }
  }
}

agy

Not verified.

$server = (Resolve-Path .\plugin\server.mjs).Path
agy mcp add black-gravity -- node $server
agy mcp list

Other MCP clients

Partial. Only the server side was checked. Start node <absolute path to plugin/server.mjs> as a stdio server. The process reserves stdout for JSON-RPC.

Linux and macOS

Supported on Linux for the Codex and Claude Code lines, checked on Ubuntu 26.04 by a user without root; the agy line is not verified. Not verified on macOS. These commands are the same registrations without PowerShell syntax. If claude is not on PATH, run the Claude Code CLI by its absolute path, as the check did.

server="$PWD/plugin/server.mjs"
codex mcp add black-gravity -- node "$server"
codex mcp list
claude mcp add --scope user black-gravity -- node "$server"
claude mcp list
agy mcp add black-gravity -- node "$server"

OpenCode as a delegated write executor

OpenCode 2.4.3 can remove Git worktrees through its file-edit permission. The bridge denies edits to the worktree root and requires OS containment for writes. Use Linux with Bubblewrap that supports --overlay, working unprivileged user namespaces, and a kernel and filesystems that can mount the overlay. Windows and macOS support read-only delegation; agy remains available for writes there and when Linux containment is unavailable.

The bridge uses private configuration with fixed file-tool rules, without project/global MCP servers or plugins. Native account connections stored by OpenCode can be reused. A provider defined only in the user's global OpenCode configuration is unavailable to delegated writes. An explicit, saved or resumed model must be listed by the contained models --standalone catalog before the task is admitted (MODEL_NOT_AVAILABLE if absent).

Keep the project, bridge state, and native data in separate directories. The native opencode data directory and its SQLite files must belong to the current user, with no group/other write permissions; the files must be regular and have no aliases or extra links. The bridge mounts the native data as a read-only lower layer. The private writable upper layer can contain the database, session history and credentials; retained tasks keep it until discard. A task does not write a credential change back to the native store.

  • OPENCODE_WRITE_UNCONTAINED: unsupported platform, unavailable Bubblewrap, or unsafe path overlap/alias. Use a supported Linux setup or separate the affected paths, as indicated.

  • OPENCODE_WRITE_RUNTIME_UNAVAILABLE: the private overlay or native data could not be prepared. Check the mount requirements and the location, owner and types of the database files. OPENCODE_NATIVE_DATA_UNSAFE_MODE identifies group/other writability specifically; verify the owner and group before applying the suggested permission change.

  • OPENCODE_CONFIG_REFUSED: the bridge could not verify that the effective configuration excludes inherited MCP servers and plugins. OPENCODE_WRITE_RUNTIME_CLEANUP_FAILED means the bridge could not remove the private overlay storage.

  • OPENCODE_COPY_DAMAGED: the damaged copy cannot be previewed, integrated, reused, or removed by retention. Use black_gravity_discard for manual removal. If process cleanup is unverified, PROCESS_CLEANUP_UNVERIFIED can also block copy operations.

  • openCodeCredentialCheck reports unchanged, changed with counts and available original account labels, or unavailable when the comparison could not be verified. Labels are bounded and filtered; a new connection without an original account cannot be identified, and legacy account rows may lack a provider. Affected connections may need a new login outside the task.

Linux Bubblewrap test executor (linux-bwrap)

When BRIDGE_TEST_EXECUTOR is unset on Linux, black_gravity_test uses linux-bwrap only if startup detection finds bwrap and passes the user-namespace probe; otherwise it stays on agy (also selectable explicitly with BRIDGE_TEST_EXECUTOR=agy).

Use a distribution package if it supplies a usable Bubblewrap. For OpenCode writes, use the commands below only if the resulting version supports overlay mounts and the host can mount them. A version or --help check alone does not establish mount support. Without working Bubblewrap, black_gravity_test stays on agy when BRIDGE_TEST_EXECUTOR is unset.

sudo apt install bubblewrap    # Debian / Ubuntu
sudo dnf install bubblewrap    # Fedora / RHEL
sudo pacman -S bubblewrap      # Arch Linux

Then check, without root, whether Bubblewrap can create a user namespace:

bwrap --unshare-user --ro-bind / / true && echo ok

If it prints ok, skip the next step. On the verified Ubuntu 26.04.1 server, the apparmor package ships and loads a bwrap profile (/etc/apparmor.d/bwrap-userns-restrict) that allows user namespaces and confines the processes started by bwrap. Do not add the profile below where such a profile is loaded: apparmor_parser -r replaces any loaded profile with the same name, whatever the file name.

Where AppArmor restricts unprivileged user namespaces and no suitable profile is loaded, an administrator can grant userns specifically to /usr/bin/bwrap. This profile uses flags=(unconfined), so it does not add AppArmor confinement to bwrap or its children. It leaves the system-wide user-namespace policy in place:

sudo tee /etc/apparmor.d/bwrap >/dev/null <<'EOF'
abi <abi/4.0>,
include <tunables/global>

profile bwrap /usr/bin/bwrap flags=(unconfined) {
  userns,

  include if exists <local/bwrap>
}
EOF
sudo apparmor_parser -r /etc/apparmor.d/bwrap

The mounts, seccomp filter, FIFO checks, refusals and threat model of the executor are described in Linux Bubblewrap test executor.

Build from source

git clone https://github.com/Zythenth/black-gravity.git
cd black-gravity
npm.cmd ci
npm.cmd run build:plugin

The PowerShell examples use npm.cmd. Use npm on other platforms. See installation and migration for standalone MCP registration, local tarballs, and upgrades. The published legacy package antigravity-mcp-bridge uses antigravity_* tools. See available versions for the Black Gravity names. If you use Windows LPAC, see portable Node setup.

Related MCP server: antigravity-plugin-codex

First use

In a new Codex conversation, try:

Use $black-gravity to inspect the selected files and report findings in read-only mode.

The skill guides model selection, waiting, and review. For a standalone MCP setup, call black_gravity_health to check the CLI, tool profile, and approval mode, then call black_gravity_list_models before choosing a model. See task management and review and integration.

Managed agy tasks can create and reuse a project even when the Antigravity app has unrelated records named like owner/repo. Those names cannot be selected through BRIDGE_AGY_PROJECTS, but the records still count in ID and folder conflict checks. The bridge reads the registry without editing it and never falls back to the default project. See Antigravity project setup.

Requirements

Black Gravity disables automatic updates only for agy processes it starts. To update the CLI outside the bridge, open agy directly in your terminal or run agy update.

Host permissions

black-gravity permissions prints host rules to review and merge into the host configuration. From the source checkout:

node plugin/server.mjs permissions --host claude-code
node plugin/server.mjs permissions --host codex

Host approval and the bridge’s BRIDGE_APPROVAL_MODE apply independently. The default auto mode applies verified patches without a bridge confirmation form. Set BRIDGE_APPROVAL_MODE=ask to require the form. See host permissions for presets, placement, and the verification limit for per-tool Codex approvals.

Available Tools

23 tools
antigravity_cancelCancel Antigravity taskA

Cancel a queued task or terminate its local agy process.

Inputs: taskId (required). Returns: task, error

antigravity_cleanupClean expired isolated copiesA
Destructive

Remove finished copies older than COPY_RETENTION_HOURS. Active copies are preserved.

Inputs: no named parameters. Returns: error, discardedTaskIds

antigravity_discardDiscard an isolated copyA
Destructive

Delete the copy and baseline of a finished task, including resumed tasks sharing that copy. Active copies are refused. The source project is preserved.

Inputs: taskId (required). Returns: task, error

antigravity_eventsRead Antigravity eventsB
Read-only

Read live normalized agy events after a sequence cursor. Includes original agy event payloads.

Inputs: taskId (required), after, limit. Returns: error, events, truncated, nextCursor, +1 more

antigravity_get_modelGet selected modelA
Read-only

Return the default model selected for subsequent bridge tasks. Null means agy chooses its own default.

Inputs: no named parameters. Returns: error, model

antigravity_healthCheck Antigravity CLIB
Read-only

Inspect installed agy version, authentication and supported capabilities.

Inputs: no named parameters. Returns: path, error, version, installed, +3 more

antigravity_integrateIntegrate reviewed changesA
Destructive

Request human confirmation through MCP form elicitation, then apply the reviewed patch. Requires the SHA-256 from antigravity_preview. Clients without form elicitation cannot integrate; no tool argument substitutes for user confirmation.

Inputs: taskId (required), expectedSha256 (required). Returns: error, files, patch, sha256, +4 more

antigravity_list_modelsList Antigravity modelsB
Read-only

List model IDs actually returned by agy models for this account.

Inputs: no named parameters. Returns: error, models

antigravity_list_project_filesList files eligible for a project copyB
Read-only

List tracked and untracked files excluding Git ignore and local exclude matches.

Inputs: workingDirectory (required). Returns: error, files

antigravity_previewPreview isolated changesC
Read-only

Return A/M/D files, per-file line statistics, totals, binary markers, patch, SHA-256 and client-reported test evidence with stale markers. Requires a finished task.

Inputs: taskId (required), includePatch. Returns: error, files, patch, tests, +7 more

antigravity_read_patchRead patch by file or chunkA
Read-only

Read at most 50000 UTF-16 units of the current patch, optionally selecting a changed path. Bind every read to the full preview hash. Follow nextOffset until hasMore is false. Use preview with includePatch false for metadata.

Inputs: taskId (required), expectedSha256 (required), path, limit, +1 more. Returns: path, text, error, length, +8 more

antigravity_read_resultRead result in chunksA
Read-only

Read the final CLI result serialized as JSON in bounded chunks. Returns ready false while active. Keep contentSha256 for subsequent requests and reconstruct the JSON by concatenating text.

Inputs: taskId (required), limit, offset, expectedContentSha256. Returns: text, error, ready, length, +8 more

antigravity_record_testRecord review test evidenceA

Record a test already executed by the client in the isolated copy. Bind command, exit code and output to the reviewed patch. These are client-reported results; the bridge does not execute or independently verify the command. Do not include secrets in output.

Inputs: taskId (required), command (required), exitCode (required), expectedSha256 (required), +1 more. Returns: error, output, sha256, source, +10 more

antigravity_resultGet Antigravity resultA
Read-only

Return terminal result, usage and error once the task finishes. Use antigravity_preview for the patch.

Inputs: taskId (required), includeResult. Returns: task, error, ready, reportAvailable, +2 more

antigravity_resumeResume Antigravity conversationC
Destructive

Continue a completed session in its existing isolated copy.

Inputs: prompt (required), sessionId (required), workingDirectory (required), mode, +6 more. Returns: task, error

antigravity_runRun Antigravity taskB
Destructive

Copy non-ignored project files to a temporary directory and run agy --sandbox there. includePaths narrows copied files or folders. Returns a taskId; source is unchanged.

Inputs: prompt (required), workingDirectory (required), mode, role, +6 more. Returns: task, error

antigravity_sessionsList known Antigravity sessionsA
Read-only

List conversation IDs recovered from local persisted tasks. agy does not advertise a session-list command.

Inputs: no named parameters. Returns: error, scope, sessions

antigravity_set_modelSelect Antigravity modelA

Persist an exact model ID from agy models as the bridge default. Null persists Auto (agy default), overriding BRIDGE_DEFAULT_MODEL. Does not alter agy global settings.

Inputs: model (required). Returns: error, model

antigravity_statusGet Antigravity task statusB
Read-only

Return task metadata, status, process ID and isolated copy path when available.

Inputs: taskId (required). Returns: task, error

antigravity_tasksList persisted tasksA
Read-only

Recover task IDs and metadata from local bridge state, including tasks from earlier server processes.

Inputs: no named parameters. Returns: error, tasks

antigravity_testRun tests in the native agy sandboxA
Destructive

Start an asynchronous continuation that executes an exact command through agy run_command. Captures actual output, exit status and file fingerprints. Optionally permits up to three repair retries. No Docker or host execution fallback. Use the returned taskId for events, result, review and integration.

Inputs: taskId (required), command (required), expectedSha256 (required), retries, +1 more. Returns: task, error

antigravity_usageRead observed token usageA
Read-only

Consolidate final CLI usage by retained task, session and requested model. Resumed task counters are session deltas, not repeated cumulative totals. Missing counters stay null. This does not report account quota or billing; disclose partial or unavailable usage to the user.

Inputs: model, taskId, sessionId. Returns: error, scope, byTask, byModel, +4 more

antigravity_verifyVerify task acceptance criteriaB

Check actual artifacts and ground Codex review quotes in file lines. Requires criteria defined before the task. A CLI SUCCESS or unsupported claim is not verification; client review remains client-reported.

Inputs: taskId (required), expectedSha256 (required), reviews. Returns: error, checks, review, sha256, +3 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 23 tools

    Disambiguation4/5

    Tools generally target distinct lifecycle stages (run/resume/cancel, preview/read_patch/read_result, test/verify/integrate), but several reading/status tools have adjacent purposes. The descriptions help separate result vs read_result and preview vs read_patch, though an agent could still confuse them.

    Naming Consistency4/5

    All tools consistently use the antigravity_ prefix with snake_case, which makes the set predictable. Most names are verb_noun or verb_noun-phrase, but some are noun-only query tools (usage, status, tasks, events, result, sessions), a minor deviation from a strict pattern.

    Tool Count3/5

    23 tools is heavy for a single MCP server and sits in the borderline 16-25 range. The domain is complex, but several output-reading and status tools could be consolidated, making the surface feel somewhat over-scoped.

    Completeness4/5

    The surface covers model selection, task lifecycle, file listing, patch/result reading, testing, verification, integration, and cleanup. Minor gaps exist, such as no explicit authentication/login tool or direct source-file read outside task artifacts, but core workflows are covered.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables a local Codex chat to ask a second opinion, review staged, unstaged, or revision-based diffs, and delegate coding tasks to the Antigravity CLI running in isolated or disposable workspaces. Supports starting, polling, retrieving, and cancelling tasks with returned answers, diffs, changed-file lists, exit codes, and time/output limits, while never auto-applying returned patches.
      8
      1
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Bridges any MCP client to the official Antigravity agy CLI, letting users delegate tasks, analyze files, search code, look up docs, and request adversarial reviews from their own Antigravity subscription models. Supports dynamic model discovery, multi-turn session follow-up, and async long-running tasks without replacing the client's main model.
      10
      1
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables MCP clients such as Claude Code and Cursor to delegate long multi-step coding tasks to Google Antigravity CLI, generate read-only plans and code reviews, digest large codebases, and manage background sessions in isolated git worktrees.
      15
      152 npm
      2
      MIT