agy-agent-mcp
This MCP server turns the Antigravity CLI into sub-agent tools for delegating, monitoring, and managing agent tasks.
Delegate coding tasks with
general_taskin accept-edits mode, or read-only exploration/diagnosis withexplore_taskin plan mode.Run delegated tasks synchronously and wait for the final report, or start them in the background and collect results later.
Configure runs with prompt,
cwd, model, effort, agent profile, project, extra directories, sandboxing, auto-approval, edit scope, idle timeout, and conversation resume.Use
watch_taskto inspect live/recent transcripts, poll progress, wait for completion, or cancel runs owned by the server process.Use
list_modelsandlist_agentsto discover accepted model IDs and custom agent profiles.Get back task status, response, token usage, files touched, transcript/receipt paths, and audit details such as denied actions or scope violations when applicable.
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., "@agy-agent-mcp Fix the failing auth tests and summarize the files you changed"
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.
agy-agent-mcp
An MCP server that turns the Antigravity CLI (agy) into five sub-agent tools.
You delegate a task, the call blocks, and you get the sub-agent's final report back.
Several delegations can run at once, each with its own transcript and result.
Install
Requires Node >= 22.6 and an authenticated agy CLI.
npm install -g agy-agent-mcpRegister with OpenCode, Claude Code, or Antigravity itself:
# OpenCode
opencode mcp add agy -- agy-agent-mcp
# Claude Code
claude mcp add agy -- agy-agent-mcp
# Antigravity
agy mcp add agy-agent agy-agent-mcpIf agy is not on PATH, add --env AGY_BIN=/path/to/agy to any of the above.
OpenCode: pass --global to mcp add to register once for every project (writes ~/.config/opencode/opencode.json). Project configs defining the same server name override the global entry, so remove per-project agy blocks after switching.
After upgrading the installed package, restart the MCP client or reload its catalog (opencode api post /api/location/reload -d '{}' for OpenCode) — sessions spawned before the upgrade keep replaying the old boot failure otherwise.
From a local checkout (npm install first): opencode mcp add agy -- "$(pwd)/bin/mcp.mjs".
Related MCP server: sub-antigravity
Quickstart
Call general_task to delegate a coding task and wait for the final report:
{
"name": "general_task",
"arguments": {
"prompt": "Fix failing tests in test/parser.test.ts and verify the build passes",
"cwd": "/path/to/project"
}
}The call blocks until the sub-agent finishes and returns its summary:
{
"task_id": "task_a1b2c3d4",
"status": "success",
"response": "Fixed the off-by-one error in src/parser.ts and verified all tests pass.",
"usage": {
"input_tokens": 12450,
"output_tokens": 830,
"total_tokens": 13280
},
"files_touched": ["src/parser.ts", "test/parser.test.ts"],
"conversation_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"stream_file": "/tmp/agy-agent-mcp/tasks/task_a1b2c3d4.stream",
"transcript_file": "/tmp/agy-agent-mcp/tasks/task_a1b2c3d4.ndjson"
}A refused call returns {"error": "..."} with isError: true, the message names the offending argument, and nothing is spawned:
{
"error": "missing required argument: prompt"
}A failed run comes back with isError: true and status of error, timeout or quota_error, and error carries the CLI's own message.
Tools
Tool | Mode | Default Effort | Purpose |
|
|
| Delegate a coding task that may edit files and wait for the report. |
|
|
| Delegate a read-only diagnosis or exploration task without editing files. |
| — | — | Inspect live transcripts, poll progress, collect results, or cancel runs. |
| — | — | List model IDs accepted by the |
| — | — | List custom agent profiles accepted by the |
general_task and explore_task
general_task runs in accept-edits mode (it may edit files), default effort: "medium".
explore_task runs in plan mode (read-only), default effort: "low".
Everything else is the same for both:
prompt(string, required): Full, self-contained task description for the sub-agent.model(string, optional, default: CLI default): Model ID to use (e.g.gemini-3.8-flash).effort(stringlow|medium|high, optional): Reasoning effort tier ("medium"default forgeneral_task,"low"forexplore_task).agent(string, optional, default: CLI default): Antigravity agent profile (seelist_agents).cwd(string, optional, default: server cwd): Project directory for the delegated task.background(boolean, optional, default:false): Start task detached in background and return handle immediately.timeout_ms(integer0..3600000, optional, default:900000): Idle timeout in ms before killing silent child (0disables).edit_scope(array of strings, optional, default: unset): Paths defining expected edit boundary for change auditing.add_dirs(array of strings, optional, default: unset): Extra directories to add to workspace (--add-dir).sandbox(boolean, optional, default:false): Enable Antigravity terminal command sandboxing (--sandbox).auto_approve(boolean, optional, default:false): Pass--dangerously-skip-permissionsto stop headless auto-denials.project(string, optional, default: unset): Antigravity project ID or name.conversation_id(string, optional, default: unset): Existing Antigravity conversation UUID to resume.
A tier-carrying model ID (e.g. gemini-3.8-flash-high) already encodes its tier and must not be paired with a conflicting effort.
Headless runs never prompt: tools requiring user confirmation are denied automatically and surfaced in denied_actions. Add rules under permissions.allow in your Antigravity settings.json to grant access.
watch_task
Reads recent activity, polls progress, collects complete results, or stops runs:
stream_file(string, optional, default: latest run): State path,task_<id>.streamfilename, or task ID.tail_lines(integer0..2000, optional, default:400): Trailing transcript lines to return (0for all).wait(boolean, optional, default:false): Wait for run to finish and return complete final result in one call.cancel(boolean, optional, default:false): Stop the running task immediately. Cannot combine withwait: true.
list_models
Lists model IDs accepted by model. Takes no arguments (any argument is refused).
Output: Raw CLI output in models and parsed model names in model_ids.
list_agents
Lists agent profiles accepted by agent (rejects any arguments).
Output: Configured custom agent profiles in agents.
Two ways to delegate
Way 1 — just delegate: The call blocks until the sub-agent finishes, and you get the final report back.
Way 2 — delegate and collect later: Pass
background: trueto receive a handle immediately, then:watch_task({ stream_file, wait: true })collects the complete result in one call without polling;watch_taskalone polls live transcript lines and the step digest while running;cancel: truestops the in-flight child process.
Several delegations can run concurrently, each with its own transcript and result. When runs share a git working tree, files_touched and scope_violations may include other runs' changes, which the result flags with audit_note. A wait for a run owned by another server process is refused with an error envelope telling you to poll instead; a cancel for such a run is reported as ignored, with a hint that the run belongs to another process.
Watching a run live
Every run streams live activity to <AGY_MCP_STATE_DIR>/task_<id>.stream (default /tmp/agy-agent-mcp/tasks/task_<id>.stream).
The result is the sub-agent's summary, not its transcript; the transcript is on disk (.stream for humans, .ndjson for machines) and the result carries the paths.
You can watch any run live from a terminal with tail -f:
tail -f /tmp/agy-agent-mcp/tasks/task_<id>.streamSample transcript:
session open · cwd=/tmp/probe · permission_mode=request-review · tools=60
● user_input
● agent_response
⎿ done in 3.5s · 8059 tokens
← Write /tmp/probe/hello.txt
⎿ done in 1.2s
→ Read /tmp/probe/hello.txt
⎿ 1 lines, 6 bytes · done in 0.02s
● agent_response
Created /tmp/probe/hello.txt with the word probe.
⎿ done in 3.4s · 2198 tokens
== done: status=SUCCESS · 12.1sWhether the client shows live progress depends on the client (OpenCode does not, Claude Code does).
Call watch_task for an in-protocol view of the live step digest (steps, step_count, phase, usage_latest) and recent transcript lines.
Live-follow companion CLI
npx agy-agent-follow --model gemini-3.8-flash --effort high "summarize the open TODOs in src/ in one paragraph"Delegates through the same runner as the MCP tools; every mirrored transcript line is printed to stdout as it is written, with the machine-readable result JSON right before exit (exit code
0only onstatus: "success").--tool general|exploreswitches the posture (accept-editsvs read-onlyplan), plus--cwdand--timeout-ms.--effort low|medium|highsets the reasoning tier; a model ID that already carries one (e.g.gemini-3.8-flash-high) must not repeat a different tier — that combination is refused locally, before any task is spawned.Ctrl-C / SIGTERM kill the in-flight
agychild (receipts in the same tasks directory).
If something goes wrong
Symptom | Cause | What to do |
Refused call | Input argument validation failed before any child process was spawned. | Fix the argument named in the error message and call the tool again. |
Failed run | The sub-agent exited non-zero, timed out, or hit a quota ceiling. | Inspect |
Missing permission | A tool required user approval that headless execution cannot provide. | Pass |
Unknown model ID | The CLI does not recognize the ID, or it carries a tier that conflicts with an explicit |
|
Configuration
Variable | Default | Purpose |
|
| Path to the Antigravity CLI binary. |
|
| Per-run idle timeout in ms (15 min, resets on child output; |
|
| Hard wall-clock timeout ceiling per run in ms ( |
| unset | Directory jail restricting allowed task |
|
| Directory for task |
|
| Days to retain task transcripts and receipts on startup sweep ( |
| unset | Set to |
Development
npm test # offline test suite (test/client6.ts, fake agy binary)
node test/client.ts # maintainer live e2e test (requires agy auth + trusted workspace)
npm run lint # check formatting and lint rules with Biome
npm run lint:fix # auto-apply Biome formatting and safe fixesSee CONTRIBUTING.md for development setup (behavior lives in code and the test suite's summary lines).
MIT, see LICENSE.
Available Tools
5 toolsexplore_taskRun read-only Antigravity exploration taskA
Delegate read-only task to agy sub-agent (plan mode, read-only). Prompt must be self-contained. Blocks until finished, returning report (status, response, usage, files_touched, transcript paths). Default effort: low. background: true returns handle immediately (collect with watch_task). conversation_id resumes earlier thread. Headless runs auto-deny gated tools (in denied_actions; auto_approve skips).
Inputs: prompt (required), cwd, agent, model, +9 more.
general_taskRun general-purpose Antigravity sub-agent taskA
Delegate coding task to agy sub-agent (accept-edits mode, may edit files). Prompt must be self-contained. Blocks until finished, returning report (status, response, usage, files_touched, transcript paths). Default effort: medium. background: true returns handle immediately (collect with watch_task). conversation_id resumes earlier thread. Headless runs auto-deny gated tools (in denied_actions; auto_approve skips).
Inputs: prompt (required), cwd, agent, model, +9 more.
list_agentsList available agy agentsA
List agent profiles for agent argument. Returns agents (raw agy agents output). Empty output means no custom agent configured.
Inputs: no named parameters.
list_modelsList available agy modelsA
List models for model argument. Returns models (raw agy models output) and model_ids (parsed ids). CLI lists tier-carrying ids only; bare ids like gemini-3.8-flash are valid for model but not in list.
Inputs: no named parameters.
watch_taskWatch live or recent task stream transcriptA
Read transcript tail of an agy run (snapshot, not follow; no args = latest run). Digest: steps (50 most recent), step_count (total; step_count > steps.length means clipped), phase, elapsed_seconds, usage_latest, content (raw tail). Finished runs carry complete final result (failed run says why). wait: true blocks until finished in one call (not combinable with cancel; cannot await foreign run). cancel: true stops owned run (foreign/ambiguous reported ignored with hint).
Inputs: wait, cancel, tail_lines, stream_file.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a clearly distinct action: launching write-capable tasks (general_task), read-only tasks (explore_task), monitoring runs (watch_task), and enumerating models/agents. The two task tools are separated by mode (accept-edits vs plan) and the descriptions make the boundary explicit. No tool pair is likely to be misselected.
Names are readable and follow a loose grouping convention: task-oriented tools end in `_task` while enumeration tools use `list_` prefix. This is not a single strict verb_noun pattern throughout, but the deviation is minor and predictable rather than chaotic.
Five tools is well-scoped for a sub-agent delegation server: two launch modes, one monitor/control tool, and two discovery tools. Cancel and wait are folded into watch_task rather than becoming separate tools, which keeps the surface lean without losing capability.
The core lifecycle is covered: launch (two modes), monitor/wait/cancel, resume via conversation_id, and enumerate models/agents. Minor gaps exist — there is no tool to list all runs (watch_task with no args only resolves the latest) and foreign runs cannot be awaited — but agents can work around these.
Maintenance
Related MCP Connectors
Develop, manage, and debug Railway projects, services, and deployments from within agents.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Hosted coding agent: start, follow up on and stop tasks that can open GitHub pull requests.
Run and manage AI agent tasks on tavya: create, search and steer tasks, read wikis, call the API.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables MCP-compatible coding agents to run the local Antigravity CLI as a coding agent, manage conversation context and common options, and inspect usage, quota, models, version, help, and read-only slash commands.MIT
- AlicenseAqualityDmaintenanceEnables AI harnesses to delegate code analysis, modification, testing, and long-running tasks to the locally installed Antigravity CLI via stdio MCP, with job status tracking and conversation continuity.3MIT
- AlicenseBqualityCmaintenanceEnables 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.81MIT
- AlicenseBqualityBmaintenanceEnables delegating coding tasks to the official Antigravity CLI from any MCP client, with task listing, model selection, streamed event tracking, cancellation, and resumable sessions. Runs each task against an isolated copy of the repository so results can be previewed, tested, and only integrated into the original after explicit user confirmation.23MIT