codex-agy-bridge
This server is an MCP control plane for running and managing durable, parallel, human-operable Antigravity (agy) CLI sessions.
Launch, continue, and interact with Antigravity runs in task or interactive modes via
agy_run_start.Start runs that wait for a specified file to appear using
agy_start_with_expected_file.Wait efficiently for sparse run events (
agy_run_wait) such as attention, terminal output, completion, or any event.Observe runs at different levels: full state, status, transcript, or terminal views (
agy_run_observe).Send guarded input to live runs with stale-write protections (
agy_run_input).Cancel active runs and terminate their process groups safely (
agy_run_cancel).Retrieve final run results, including bounded result chunks via byte offsets (
agy_run_result).Manage coordinated multi-target goals with bounded parallelism, shared objectives, and aggregate status (
agy_goal).Run typed code reviews on commits or branch/working-tree changes and consume validated review results (
agy_review_commit,agy_review_branch,agy_review_result).Refresh Antigravity authentication and optionally open a login terminal session (
agy_login).Access diagnostics, available models, plugins, run validation, and changelog info (
agy_admin).Preserve run state across MCP server restarts and keep runs operational via persistent tmux sessions and detached supervisors.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@codex-agy-bridge start an agent run in /Users/me/myproject to fix bugs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
codex-agy-bridge
Run Antigravity from an agent harness as durable, parallel, human-operable
agy sessions over MCP.
codex-agy-bridge wraps the official Antigravity CLI with a resumable MCP
control plane. Agent harnesses like Codex, Claude Desktop, or your own
GPT/Claude-powered MCP client can start agy runs, wait on sparse events,
attach a real terminal, send guarded input, cancel safely, continue exact
conversations, and collect final results later by run_id.
Quick Install
Prerequisites:
Codex CLI for the command below, or another local stdio MCP-capable harness
The official Antigravity CLI (
agy), already authenticated locallyuv/uvxtmuxand a supported terminal launcher:
# macOS
brew install tmux
# Debian/Ubuntu Linux (x-terminal-emulator is also supported)
sudo apt install tmux gnome-terminalCheck the required commands:
codex --version
agy --version
agy models
uvx --version
tmux -VDay 0 Authentication
agy --version only proves the binary exists. Before adding the MCP server,
run agy models; if Antigravity asks you to sign in or reports that you are
not logged in, start a visible session and complete the browser/login flow:
agy --prompt-interactive "Authenticate Antigravity and then exit."
agy modelsAfter agy models succeeds, install or restart the MCP server. If a bridge run
still hits auth, agy_run_start returns status="auth_required" and opens a
visible agy authentication session by default. Complete sign-in there, then
start a fresh run. You can also use agy_run_observe(view="terminal") or
agy_admin(action="doctor") to inspect the auth-required status.
Install from PyPI with the Codex CLI:
codex mcp add codex-agy-bridge \
--env AGY_CMD="$(command -v agy)" \
-- "$(command -v uvx)" codex-agy-bridge@latestRestart the harness, then verify in Codex if you used the command above:
codex mcp get codex-agy-bridge
codex mcp listRemove it with:
codex mcp remove codex-agy-bridgeFor Claude Desktop or a custom MCP client, use the same stdio command shape:
uvx codex-agy-bridge@latest with AGY_CMD set to the authenticated agy
executable.
Related MCP server: codex-mcp-opencode
What Makes It Different
Parallel Antigravity sessions: launch multiple independent
agyruns, each with its own durable state, logs, transcript projection, and result.Human-operable terminals: foreground runs live in persistent
tmuxsessions, so Terminal.app can attach without killing the agent.Resumable MCP control: MCP calls can time out, the harness can restart, and the run can still be observed later by
run_id.Goal orchestration: create a goal, start named targets with bounded parallelism, and inspect the whole batch as one coordinated effort.
Sparse wake events:
agy_run_waitshort-polls lifecycle, attention, progress, and terminal events without transcript-polling spam.Guarded input:
agy_run_inputcan reject stale writes when event or transcript cursors changed after the caller observed the run.Trajectory-aware observability: bounded transcript summaries and terminal evidence are exposed without private model reasoning.
Operational hygiene: duplicate active starts are deduplicated, process groups are cancelled safely, and completed result artifacts are preserved.
Install Details
If You Are An Agent Reading This
Help the user install it; do not silently mutate their machine.
Verify prerequisites first:
command -v codex
command -v agy
command -v uvx
command -v tmux
agy --version
agy modelsIf anything is missing, ask before installing it.
If
agy modelsreports an auth error, help the user complete the Day 0 authentication flow above before adding the MCP server.Then run:
codex mcp add codex-agy-bridge \
--env AGY_CMD="$(command -v agy)" \
-- "$(command -v uvx)" codex-agy-bridge@latestVerify:
codex mcp get codex-agy-bridge
codex mcp listTell the user to restart their agent harness so the new MCP tools load.
PyPI
The Quick Install command stores an stdio MCP server definition. When the agent
harness starts the server, uvx resolves codex-agy-bridge@latest from PyPI,
installs it into an isolated cached environment, and runs the
codex-agy-bridge console script. AGY_CMD pins the bridge to the user's
already-installed and authenticated agy executable.
Do not replace $ or $(...) manually in the command. In POSIX shells,
$(command -v agy) and $(command -v uvx) expand to absolute executable
paths.
GitHub
Use this when you want the repository version directly:
codex mcp add codex-agy-bridge \
--env AGY_CMD="$(command -v agy)" \
-- uvx --from git+https://github.com/varadfromeast/codex-agy-bridge \
codex-agy-bridgeLocal Development
git clone https://github.com/varadfromeast/codex-agy-bridge.git
cd codex-agy-bridge
uv sync --extra dev
codex mcp add codex-agy-bridge \
--env AGY_CMD="$(command -v agy)" \
-- uv --directory "$PWD" run codex-agy-bridgeHow It Works
flowchart LR
H["Agent harness<br/>(Codex, Claude, custom MCP client)"]
M["codex-agy-bridge<br/>MCP stdio server"]
S["Durable control plane<br/>runs, goals, events, results"]
W["Detached run supervisor"]
A["Antigravity CLI<br/>agy"]
T["Persistent tmux session<br/>human attach/input"]
L["Local Antigravity<br/>trajectory files"]
H <-->|"MCP tools"| M
M <--> S
S --> W
W --> A
W <--> T
A --> L
W -->|"bounded transcript projection"| S
T -->|"terminal logs and attention prompts"| SThe bridge keeps the MCP server responsive while detached supervisors own the
long-running agy processes. State and events are persisted locally, so a run
can continue after the original MCP call returns. For the deeper process model,
see docs/ARCHITECTURE.md. For the MCP control-loop
vision, see docs/MCP_VISION.md.
MCP Tools
Tool | Purpose |
| Start, continue, or open an interactive foreground run |
| Short-poll until selected runs emit sparse wake events |
| Read full, status, transcript, or raw terminal views |
| Send input with optional event/transcript preconditions |
| Cancel one active run |
| Read final result metadata or bounded result chunks |
| Create goals, start targets, and read aggregate status |
| Read diagnostics, models, plugins, validation, and changelog |
Omit model (or pass null) to let Agy choose its default: the bridge stores
model: null and does not send --model. This applies to runs, review tools,
and goals, whose targets inherit their goal's selection. Explicit selections
are validated against agy models, including the bridge's former
Gemini 3.5 Flash (Medium) default; unknown and empty selections are rejected.
The bridge never substitutes the first catalog entry. agy_admin(action="models")
reports default_model: null and default_model_source: "agy_cli"; this describes
delegation, not an observed effective provider model.
Existing persisted runs and goals retain their model strings and remain readable. They are not silently migrated to a different model. New launches from an old goal revalidate its selection and reject it if it is no longer available; create a new goal with an available model or omit the selection to delegate to Agy. Previously reserved runs retain their original command policy. New delegated requests have distinct deduplication keys from explicitly selected models. Older bridge versions that require a string goal model cannot read new null-model goals; avoid downgrading with those goals in use.
Typical flow:
agy_run_start -> agy_run_wait -> agy_run_observe -> agy_run_resultIn Codex MCP, tools may be exposed with the server prefix, for example
codex_agy_bridge_agy_run_wait. Run responses include exact wait_call
arguments; note that agy_run_wait always takes run_ids: ["..."], even for a
single run. Supported wait conditions are any_attention, any_terminal,
all_terminal, any_event, and aliases attention, terminal, finished,
finish, complete, completed, result, all_finished, all_complete, and
all_completed.
Use agy_goal when the harness should split work into named targets with a
shared objective and bounded parallelism.
Configuration
Variable | Default | Purpose |
|
| Exact Antigravity executable |
|
| Durable run and goal state |
|
| Antigravity conversations and trajectories |
|
| Global concurrent-run limit |
|
| Time a final marker must remain stable |
|
| Max seconds a single |
Run state survives MCP server restarts under
~/.local/state/codex-agy-bridge/.
Status And Risk
This project is experimental. It currently targets Python 3.11+, macOS or
Linux with a supported terminal launcher, tmux, and Antigravity CLI
1.0.8-compatible commands and trajectory files.
Antigravity is an agentic CLI. It can read and write files, execute commands, and access the network with the current user's privileges. This bridge is not a sandbox or security boundary.
The bridge always enables Antigravity's dangerous permission-skip policy so
unattended runs do not stall on CLI approval prompts. Any
dangerously_skip_permissions=false input is rejected; the only allowed value
is true. sandbox=true and additional_directories are CLI policy hints,
not filesystem containment.
The bridge does not read or copy Antigravity OAuth credentials. It invokes the
installed agy binary and reads ordinary local conversation metadata and
trajectory files.
Development
git clone https://github.com/varadfromeast/codex-agy-bridge.git
cd codex-agy-bridge
uv sync --extra dev
uv run pytest
uv run ruff check .
uv buildRun the server directly:
uv run codex-agy-bridgeThe server uses stdio transport. Do not print diagnostic text to stdout; it would corrupt MCP framing.
Publishing
A pushed version tag runs .github/workflows/publish.yml, which verifies
versions, runs checks, builds distributions, publishes to PyPI through GitHub
OIDC, creates a GitHub release, and publishes server.json to the MCP
Registry.
Compatibility
The current reader expects Antigravity trajectory JSONL under:
~/.gemini/antigravity-cli/brain/<conversation-id>/
.system_generated/logs/transcript.jsonlIf Antigravity moves to SQLite or a local daemon API, a new adapter can replace this reader without changing the MCP tool contract.
License
Available Tools
14 toolsagy_adminC
Run bounded diagnostics and metadata actions for the bridge and agy CLI.
Inputs: action (required), path, run_id, refresh, +1 more. Returns: object
agy_goalC
Manage bridge scheduler goals with actions create, start_target, status.
dangerously_skip_permissions must be true when supplied.
Inputs: action (required), model, prompt, goal_id, +8 more. Returns: object
agy_loginC
Refresh Antigravity auth state and optionally open one login session.
Inputs: refresh, force_new, workspace, open_terminal. Returns: object
agy_review_branchA
Start a typed review Run for branch and working-tree changes.
Keep issue focused and use narrow scope_paths when possible. Wait for completion with agy_run_wait, then prefer agy_review_result. Avoid frequent agy_run_observe(include_terminal_tail=True) calls unless debugging the bridge.
Inputs: issue (required), workspace (required), model, sandbox, +8 more. Returns: object
agy_review_commitA
Start a typed review Run for one commit and return immediately.
Keep issue focused and use narrow scope_paths when possible. After the run completes, prefer agy_review_result over manually polling raw artifacts.
Inputs: issue (required), commit (required), workspace (required), model, +7 more. Returns: object
agy_review_filesC
Start an artifact-gated typed review Run for local files.
Inputs: issue (required), paths (required), workspace (required), model, +6 more. Returns: object
agy_review_resultA
Validate and summarize the artifact from a typed review Run.
Preferred way to consume completed commit, branch, or file review Runs.
Inputs: run_id (required). Returns: object
agy_run_cancelC
Cancel one active Run and terminate its Antigravity process group.
Inputs: run_id (required). Returns: object
agy_run_inputB
Send input to a live foreground Run with optional stale-write guards.
Inputs: text (required), run_id (required), enter, expected_event_key, +1 more. Returns: object
agy_run_observeA
Inspect Run state through one lean observation surface.
view="full" returns merged observable state for all run_ids. view="status", "transcript", or "terminal" requires exactly one run_id and returns the corresponding focused view.
Inputs: run_ids (required), view, after, limit, +7 more. Returns: object
agy_run_resultB
Read final result metadata, or a bounded chunk when offset_bytes is set.
Inputs: run_id (required), max_bytes, offset_bytes. Returns: object
agy_run_startA
Start or continue one foreground Antigravity Run.
mode="task" starts a normal bridge-owned task. mode="interactive" starts a persistent conversation session that should be used sparingly. Supplying conversation_id continues that exact Antigravity conversation. Use agy_start_with_expected_file for reviews and other artifact-producing tasks. dangerously_skip_permissions must be true; the bridge always forwards --dangerously-skip-permissions to Antigravity.
Inputs: prompt (required), workspace (required), mode, model, +5 more. Returns: object
agy_run_waitA
Wait for sparse Run events instead of repeatedly polling status.
run_ids is always a list, even for one Run. Supported condition values: any_attention, any_terminal, all_terminal, any_event, plus aliases attention, terminal, finished, finish, complete, completed, result, all_finished, all_complete, and all_completed.
Inputs: run_ids (required), after, condition, timeout_seconds. Returns: object
agy_start_with_expected_fileC
Start one task Run that cannot complete until expected_file is non-empty.
Inputs: prompt (required), workspace (required), expected_file (required), model, +5 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Most tools cleanly separate run lifecycle, review workflows, and bridge administration. The main ambiguity is that agy_run_start, agy_start_with_expected_file, agy_review_commit, agy_review_files, and agy_review_branch are all ways to start a run, and agy_run_result versus agy_review_result require careful reading.
The shared agy_ prefix and snake_case convention make the set readable, and most tools follow a verb_noun style. Deviations like agy_start_with_expected_file, agy_admin, and agy_goal break the pattern slightly, but not enough to cause real confusion.
Fourteen tools is a well-scoped surface for a bridge that manages run execution, review workflows, goals, login, and diagnostics. Each tool covers a distinct operation without feeling bloated or redundant.
The surface covers the full run lifecycle (start, wait, observe, input, cancel, result) and the main review workflows for commits, branches, and files. There are minor gaps such as no obvious way to enumerate all active runs without prior run IDs and limited goal mutation beyond status actions.
Maintenance
Related MCP Connectors
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Hosted MCP server and Agent Skills for specs, engineering threads, and project memory.
Task management your AI agents can actually run. One line becomes a context-ready task over MCP.
Related MCP Servers
- AlicenseBqualityCmaintenanceA lightweight MCP bridge that lets Claude Code delegate heavy tasks to the Antigravity CLI - saving context window and tokens for what matters.144 PyPI12MIT
- AlicenseAqualityDmaintenanceA project-local MCP bridge that allows Codex Desktop to plan tasks and OpenCode to execute them within the current project directory, with session reuse and native OpenCode background subagents.41MIT
- AlicenseNot gradedqualityCmaintenanceA local-STDIO MCP server that lets Codex invoke the Antigravity CLI from any project, with project-owned routing guidance and enforceable policies.MIT
- AlicenseNot gradedqualityDmaintenanceThis MCP server bridges Codex to Antigravity CLI, allowing Codex to delegate coding tasks (e.g., code modification, testing, and fixing) to Antigravity within specified project directories.MIT