Antigravity Sub-Agent MCP Server
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., "@Antigravity Sub-Agent MCP Server Use a sub-agent to fix the failing tests in the auth service"
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.
Antigravity Sub-Agent MCP Server
An MCP server that lets a main AI agent spawn sub-agents on Antigravity IDE. Delegates tasks with full lifecycle management: creating cascades, auto-accepting tool actions, and extracting results.
Runs via stdio transport — configure as a command in mcp_config.json, no manual server start needed.
Table of Contents
Related MCP server: Antigravity Execution Fabric
How It Works
Main Agent (Claude/Gemini/etc)
↓ MCP tool call
↓
index.js (stdio MCP server)
↓ autoDetect(workspace) → finds correct LS instance
↓ startCascade() → sendMessage(SYSTEM_PROMPT + task)
↓
completion-loop.js (polls until done)
├─ RUNNING → keep polling (auto-accept if steps stall)
├─ WAITING_FOR_USER → auto-accept.js handles it
├─ IDLE → treat as completed
├─ Question detected → auto-reply "proceed" (max 3)
└─ COMPLETED → extract final text
↓
Returns result to Main AgentProject Structure
antigravity-sub-agent-mcp/
├── package.json
├── index.js # stdio MCP server (2 tools)
├── lib/
│ ├── ls-detector.js # LS auto-detection (PPID + process scan + workspace matching)
│ ├── cascade-client.js # HTTP client for LS API (JSON + binary + streaming)
│ ├── completion-loop.js # Smart polling with auto-accept integration
│ ├── auto-accept.js # Interaction payload builder for WAITING steps
│ └── protobuf.js # Binary protobuf encoder/decoder
├── docs/ # Internal architecture documentation
├── LICENSE # MIT License
├── CONTRIBUTING.md # Contribution guide
├── CODE_OF_CONDUCT.md # Contributor Covenant
└── CHANGELOG.md # Release historySetup
Prerequisites
Node.js 18+
Antigravity IDE running with at least one workspace open
Install
cd antigravity-sub-agent-mcp
npm installConfigure Antigravity
Add to your mcp_config.json:
{
"mcpServers": {
"antigravity-sub-agent": {
"command": "node",
"args": ["/absolute/path/to/antigravity-sub-agent-mcp/index.js"]
}
}
}Environment Variables
Variable | Default | Description |
| auto-detect | Language Server port |
| auto-detect | CSRF token |
|
| Use TLS |
When not set, the server auto-detects the correct LS instance (see Workspace Detection below).
MCP Tools
submit_agent — Non-blocking
Submit a task and get a taskId back immediately (~1s). The sub-agent runs in the background.
Same params as start_agent. Returns taskId for use with get_agent_results.
get_agent_results — Batch Wait
Wait for multiple submitted tasks and return all results at once.
Param | Type | Required | Description |
| string[] | ✅ | Array of taskIds from |
Parallel workflow:
submit_agent(task1) → taskId: "abc" ← instant
submit_agent(task2) → taskId: "def" ← instant
submit_agent(task3) → taskId: "ghi" ← instant
get_agent_results(["abc", "def", "ghi"]) → all 3 results (ran in parallel!)Model Aliases
Alias | Model |
| Gemini 3.1 Pro (High) |
| Gemini 3.1 Pro (Low) |
| Gemini 3 Flash |
| Claude Sonnet 4.6 (Thinking) |
| Claude Opus 4.6 (Thinking) |
| GPT-OSS 120B (Medium) |
Raw MODEL_* IDs also accepted.
Key Features
Workspace Detection
Auto-finds the correct LS instance:
PPID detection (primary): Parent process IS the LS — reads
--csrf_tokenand--workspace_idfrom its command lineWorkspace path matching (fallback): Matches
workspaceparam against running LS instancesFirst valid instance (last resort): Uses whatever is available
Auto-Accept
Handles all WAITING steps automatically:
Commands: Approves with the exact proposed command line
File writes: Grants file permission with the target path
File reads: Always allows (read-only)
Browser actions: Approves browser automation
Terminal input: Confirms with proposed input
Stalled-Running Detection
LS sometimes reports RUNNING status even when steps are waiting for user accept. The server detects stalled polls (steps not increasing) and proactively checks for WAITING steps to auto-accept.
Binary Protobuf Fallback
When LS JSON API returns capped results, falls back to binary protobuf which correctly respects pagination.
Debugging
All logs go to stderr:
[ls-detector] ✓ Parent LS API on port 53525 (TLS: false)
[sub-agent:abc12345] RUNNING steps=5 replies=0 elapsed=12s
[auto-accept] → Built interaction: {"runCommand":{"commandLine":"npm test"}}
[auto-accept] → handleInteraction result: ok=trueContributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project follows the Contributor Covenant Code of Conduct.
Acknowledgments
This project was built on top of and heavily inspired by Antigravity Deck — the original toolkit for automating Antigravity IDE workflows.
Key components ported and simplified from Antigravity Deck:
Cascade Client (
lib/cascade-client.js) — HTTP client for Language Server APIAuto-Accept (
lib/auto-accept.js) — interaction payload builder for WAITING stepsLS Detector (
lib/ls-detector.js) — Language Server process auto-detectionProtobuf (
lib/protobuf.js) — binary protobuf encoder/decoder
Special thanks to the Antigravity IDE team for building the platform that makes this kind of agent orchestration possible.
License
This project is licensed under the MIT License.
Available Tools
2 toolsget_agent_resultsA
Collect results from submit_agent calls. Blocks until ALL tasks finish, then returns all results together.
Call this AFTER submitting all tasks via submit_agent. Pass the taskIds you received. Note: Sometimes agents may not finish within the timeout period. In such cases, the result will be returned as is, and you may need to manually check the status of the task in the Antigravity IDE.
Inputs: taskIds (required).
submit_agentA
Spawn an autonomous agent in Antigravity IDE. Returns a taskId INSTANTLY (does NOT wait for completion).
The agent runs as a new Cascade conversation with full codebase access — it can read files, grep, run terminal commands, and edit files. It operates fully autonomously without asking questions. Each agent consumes significant resources (new conversation + model tokens), so only delegate tasks that provide real value.
ALWAYS use this 2-step pattern: Step 1: Call submit_agent N times (each returns a taskId in ~1 second) Step 2: Call get_agent_results([taskId1, taskId2, ...]) to wait for ALL results at once
All N agents run in parallel. Write self-contained prompts — the agent has ZERO prior context.
WHEN TO USE (high-value tasks): ✅ Implement a scoped feature or bug fix (write code, run tests) ✅ Research/summarize a module, architecture, or large codebase area ✅ Run a build/test suite and report results ✅ Generate boilerplate, migrations, or repetitive code ✅ Perform multi-step analysis that requires reasoning
WHEN NOT TO USE (do it yourself — faster & cheaper): ❌ Read or view files ❌ Simple grep/search operations ❌ Single-file edits that take < 30 seconds ❌ Tasks that just collect information without transforming it
Models: gemini-high (default), gemini-low, gemini-flash, claude-opus, claude-sonnet, gpt-120b.
Inputs: task (required), model, timeout, taskName, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly orthogonal roles: submit_agent starts an asynchronous task and returns a taskId immediately, while get_agent_results blocks on the collected taskIds. The descriptions explicitly encode the two-step submit-then-collect workflow, leaving no realistic room for misselection.
Both names follow the same snake_case verb_noun convention (submit_agent, get_agent_results) and the pairing is semantically symmetric within an async task lifecycle. No mixed casing or inconsistent verb styles.
Two tools is on the thin side, but it maps exactly onto the intended submit/poll async pattern, so each tool clearly earns its place. A small set of lifecycle helpers would round it out but the current count is defensible for the scope.
The core submit-and-collect loop is covered, but the surface has no way to check a single task's status, list outstanding agents, or cancel a runaway agent. The description even admits that on timeout the user must 'manually check the status of the task in the Antigravity IDE', which is a genuine dead end for an agent-driven workflow.
Related MCP Connectors
Task manager for AI agents. Orchestrate agents to achieve large goals in unified control plane.
Task tracking built for coding agents. Work is leased, so two agents never take the same SubTask.
Delegate tasks between AI agents on different platforms and collect the results.
Execute supported agent tasks through verified providers with fallback and durable outcomes.
Related MCP Servers
- AlicenseCqualityBmaintenanceEnables a primary agent in Antigravity IDE to delegate coding tasks to background subagents across multiple model backends, with crash recovery, process cleanup, and human-in-the-loop approval for destructive actions.20MIT
- AlicenseNot gradedqualityCmaintenanceEnables a single Antigravity IDE to explicitly drive multiple isolated Antigravity CLI workers, choosing each worker's account, model, skills, task, and expected outputs while the bridge executes those decisions over STDIO with SQLite-backed task state. It returns bounded logs, cancellable task control, and immutable artifact exports whose chunks and whole files can be verified by SHA-256.1MIT
- AlicenseBqualityBmaintenanceEnables an AI to delegate work to secondary Antigravity CLI accounts, running jobs in parallel with dependency (DAG) scheduling, file read/write declarations, warm multi-turn sessions, account quota tracking and compact result collection. Users simply describe their request in natural language while the AI plans and the server executes — no hand-written workflow JSON required.21MIT
- FlicenseNot gradedqualityAmaintenanceEnables a primary AI assistant to delegate tasks to multiple specialized coding sub-agents, run them in parallel with shared project context, and synthesize their responses from within the IDE.-