agent-antigravity-mcp
This server provides an MCP interface to the Google Gemini Antigravity Agent for autonomous code execution, web browsing, and more. You can:
Manage agent interactions: create, continue, cancel, list, and poll status; submit custom function results; process text and base64 image inputs; run asynchronously with token budgets.
Execute code remotely: run shell, Python, and Node.js commands in Linux sandboxes; manage sandbox environments (create, list, inspect, delete, upload/download files, snapshot as .tar).
Browse the web: integrated
google_searchandurl_contexttools.Schedule cron triggers: create, list, pause/resume, delete, run on demand, and audit execution history for recurring interactions.
Automate GitHub PRs: clone a repo, branch, complete a task, push, and open a PR with secure token injection via network allowlist.
Register managed agents: reusable named agents with persistent system instructions, default tools, and base environments.
Configure extensibility: connect external MCP servers, set pre/post hooks for tool interception, build environment configs with file sources and network rules.
Choose Gemini models like
gemini-3.6-flashandgemini-3.5-flash-lite.Reliable operation: API call fallbacks with exponential backoff and interaction session caching.
Enables GitHub Pull Request workflow: branching, committing, pushing changes, and opening PRs from a task description, with token injection via sandbox network allowlist.
Provides tools to create, manage, and continue interactions with Google Gemini Antigravity Agent, including autonomous code execution, web browsing, multimodal inputs, and function calling.
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., "@agent-antigravity-mcp create a GitHub PR to update the README with installation instructions"
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.
Agent Antigravity MCP Server
Model Context Protocol (MCP) server for Google Gemini Antigravity Agent.
Features
Autonomous Code Execution: Run shell, Python, Node.js commands in remote Linux sandbox.
Web Browsing & Search: Integrated
google_searchandurl_context.Multimodal Inputs: Process text instructions and base64 images.
Custom Functions: Support turn-based custom function calling.
Remote MCP Servers: Connect external MCP servers to Antigravity agent.
Model Selection: Choose between
gemini-3.6-flash,gemini-3.5-flash-lite, and other Gemini models.Background Execution: Async interactions with
background=Truepolling andmax_total_tokensbudget cap.Environment Config: Build remote sandbox config with file sources (inline/git/gcs) and network allowlist.
Cron Triggers: Create, list, pause/resume, delete, run, and audit scheduled recurring interactions.
GitHub PR Workflow: Point at a repo (public/private) + base branch; agent branches, does the task, pushes, opens the PR. Token injected via sandbox network allowlist, never in the prompt.
Managed Agents: Register reusable named agents (
system_instruction, default tools,base_environment) and invoke them by ID.Environments API: List/inspect/delete sandbox environments directly, and download a sandbox's full filesystem as a
.tar.Hooks Config: Mount a
hooks.json(pre/postcode_execution/file-op interception, allow/deny) into the sandbox via an inline environment source — format documented increate_interaction'senvironmentarg.
Related MCP server: Gemini Agent MCP Server
Tools
Tool | Covers |
| Interactions API create + multi-turn + function calling + |
| Interaction status, polling, cancel, delete |
| Triggers API (cron scheduling) |
| Clone repo, branch, do task, push, open PR |
| Managed Agents API (register + invoke by ID) |
| Environments API (sandbox lifecycle + file transfer) |
Note: the Interactions API supports stream=true for real-time step deltas via the
google-genai SDK directly (AntigravityClient.create_interaction(..., stream=True)),
but it's not exposed as an MCP tool — MCP tool calls are synchronous request/response,
so there's no way to surface incremental deltas over this transport.
Installation
Clone it somewhere and note the full path:
git clone https://github.com/bgembalczyk/agent-antigravity-mcp.git
cd agent-antigravity-mcp && pwdEvery client below runs the server the same way — uv run --project <that path> agent-antigravity over stdio — so you need
uv installed, but no manual venv or pip install step. In every snippet, replace PATH_TO_REPO with the pwd
output above (full path, not ~).
Claude Code (as a plugin, recommended)
No local clone needed — Claude Code clones it straight from GitHub:
/plugin marketplace add bgembalczyk/agent-antigravity-mcp
/plugin install agent-antigravity@agent-antigravity-mcpExport GEMINI_API_KEY/GITHUB_TOKEN in your shell profile before launching
Claude Code — the plugin's .mcp.json reads them via ${GEMINI_API_KEY}/${GITHUB_TOKEN}.
Antigravity CLI / IDE
File: ~/.gemini/config/mcp_config.json
"agent-antigravity": {
"command": "uv",
"args": ["run", "--project", "PATH_TO_REPO", "agent-antigravity"],
"env": { "GEMINI_API_KEY": "${GEMINI_API_KEY}", "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
}Paste that inside the top-level "mcpServers": { ... } object (create it with
just {"mcpServers": {}} if the file doesn't exist yet).
Codex CLI
File: ~/.codex/config.toml
[mcp_servers.agent-antigravity]
command = "uv"
args = ["run", "--project", "PATH_TO_REPO", "agent-antigravity"]
[mcp_servers.agent-antigravity.env]
GEMINI_API_KEY = "your_gemini_api_key"
GITHUB_TOKEN = "your_github_pat_with_repo_scope"Append that to the end of the file — TOML tables don't care what's above them. Codex doesn't expand shell vars here, so put the real key values in.
GitHub Copilot CLI
File: ~/.copilot/mcp-config.json
"agent-antigravity": {
"type": "local",
"command": "uv",
"args": ["run", "--project", "PATH_TO_REPO", "agent-antigravity"],
"env": { "GEMINI_API_KEY": "your_gemini_api_key", "GITHUB_TOKEN": "your_github_pat_with_repo_scope" },
"tools": ["*"]
}Paste inside "mcpServers": { ... } (create the file with {"mcpServers": {}}
if needed). Takes effect immediately, no restart. Same as Codex, real values
in env — Copilot CLI doesn't expand shell vars here either.
OpenCode
File: ~/.config/opencode/.opencode.json (global) or opencode.json in a
project root (project-scoped).
"agent-antigravity": {
"type": "local",
"command": ["uv", "run", "--project", "PATH_TO_REPO", "agent-antigravity"],
"environment": { "GEMINI_API_KEY": "{env:GEMINI_API_KEY}", "GITHUB_TOKEN": "{env:GITHUB_TOKEN}" }
}Paste inside "mcp": { ... } (create with {"mcp": {}} if needed).
{env:VAR_NAME} expands from your shell environment at startup. Restart
OpenCode (or reload config) after saving.
Any other MCP client / standalone
Any client that speaks MCP over stdio can launch this server the same way:
uv run --project PATH_TO_REPO agent-antigravity. If you'd rather manage the
virtualenv yourself instead of letting uv run do it:
uv venv --clear venv
uv pip install -e .
venv/bin/agent-antigravityConfiguration
Create .env file:
GEMINI_API_KEY=your_gemini_api_key
GITHUB_TOKEN=your_github_pat_with_repo_scopeGITHUB_TOKEN fallback used by create_github_pr_task when no github_token param given. Needs repo scope for private repos.
Optional:
AGENT_ANTIGRAVITY_LOG_LEVEL=INFO
AGENT_ANTIGRAVITY_SESSIONS_DB=/custom/path/sessions.db
AGENT_ANTIGRAVITY_TRANSPORT=stdio # stdio | sse | streamable-http
AGENT_ANTIGRAVITY_HOST=127.0.0.1 # sse/streamable-http only
AGENT_ANTIGRAVITY_PORT=8000 # sse/streamable-http only
AGENT_ANTIGRAVITY_MAX_REQUESTS_PER_MINUTE=60 # 0 disables limitingUsage
Once registered with any client above, the server starts automatically over
stdio whenever that client launches — nothing to run manually. In Claude Code,
the agent-antigravity skill (skills/agent-antigravity/SKILL.md) also
auto-activates when a task matches, on top of the raw MCP tools being available.
Reliability
Every API call tries the
google-genaiSDK first, falls back to direct REST on failure (logged at WARNING). REST calls retry on429/5xx/transport errors with exponential backoff (3 attempts).Interaction session cache is SQLite-backed (
~/.agent-antigravity/sessions.dbby default) and survives process restarts.CI (
.github/workflows/test.yml) runs the test suite on every push/PR.
Testing
uv pip install -e ".[dev]"
pytest -qCredit
Structure and tool/resource/prompt patterns inspired by jules-mcp-server, an MCP server for Google Jules.
License
MIT — see LICENSE.
Available Tools
27 toolsbuild_environment_configARead-onlyIdempotent
Helper tool to generate a remote sandbox EnvironmentConfig dict.
Args: sources: List of {"type": "repository"|"gcs"|"inline", "source": "url-or-content", "target": "/workspace/path", "content": "..."}. "repository" (git URL) and "gcs" use "source"; "inline" uses "content" instead. "target" is required for all and must be a subdirectory (cannot mount to "/"). network_allowlist: List of {"domain": "api.example.com"|".example.com"|"", "transform": {"Authorization": "Bearer ..."}}. Ignored if network_disabled is True. network_disabled: Block all outbound network traffic (sets network="disabled"). environment_id: Reuse an existing environment's state instead of provisioning fresh.
Inputs: sources, environment_id, network_disabled, network_allowlist. Returns: result
build_hooks_configARead-onlyIdempotent
Build a hooks.json config for sandbox-native tool interception (code_execution, read/write/list/delete_file).
Hooks only fire for sandbox-native tools, never for function calling or mcp_server tools. Mount the result at target ".agents/hooks.json" via build_environment_config's inline sources so the sandbox picks it up automatically.
Args: pre_tool_execution: List of {"matcher": "<RE2 regex, e.g. 'code_execution' or '.*_file'>", "hooks": [{"type": "command"|"http", "command"|"url": "...", "timeout": 10}]}. A "command" hook receives the tool call as JSON on stdin and must print {"decision": "allow"} or {"decision": "deny", "reason": "..."} to stdout. post_tool_execution: Same matcher/hooks shape; runs after execution, cannot block, output ignored. group_name: Top-level key grouping this hook set. enabled: Whether this group is active.
Inputs: enabled, group_name, pre_tool_execution, post_tool_execution. Returns: result
build_mcp_server_tool_configCRead-onlyIdempotent
Helper tool to generate remote MCP server configuration dict for agent tools parameter.
Inputs: url (required), name (required), headers, allowed_tools. Returns: result
cancel_interactionADestructiveIdempotent
Cancel an in-progress (e.g. background) interaction.
Inputs: interaction_id (required). Returns: result
continue_interactionA
Continue an existing interaction turn with new prompt, images, or function results.
Args: previous_interaction_id: ID of the interaction turn to continue. environment_id: Sandbox environment ID returned from previous turn. prompt: Optional follow-up prompt text. images: Optional follow-up base64 images. function_results: Optional list of function_result dicts: [{"name": "...", "call_id": "...", "result": {...}}]. agent: Agent identifier. system_instruction: Optional behavior/persona override for this turn.
Inputs: environment_id (required), previous_interaction_id (required), agent, images, +3 more. Returns: result
create_environmentA
Provision a standalone sandbox environment for reuse across multiple interactions.
Unlike passing environment=build_environment_config(...) inline to create_interaction (which forks per invocation), this persists an environment_id you can pass to create_interaction/continue_interaction directly.
Args: sources: See build_environment_config. network_allowlist: See build_environment_config. network_disabled: See build_environment_config.
Inputs: sources, network_disabled, network_allowlist. Returns: result
create_github_pr_taskA
Have the agent clone a GitHub repo, branch off base_branch, do the task, and open a PR.
Token is injected via the sandbox network allowlist header transform (never placed in the prompt text), so it stays out of interaction transcripts/logs.
Args: repo_url: e.g. "https://github.com/owner/repo" (public or private). task_prompt: What the agent should implement/fix. base_branch: Branch to start from (default "main"). work_branch: Branch name to create; auto-generated if omitted. pr_title: PR title; defaults to a summary derived from task_prompt. github_token: GitHub PAT with repo scope. Falls back to GITHUB_TOKEN env var. model: Gemini model for the interaction. agent: Agent identifier.
Inputs: repo_url (required), task_prompt (required), agent, model, +4 more. Returns: result
create_interactionA
Create a new Antigravity agent interaction.
Args: prompt: Task instruction or prompt for the agent. agent: Agent identifier (default: antigravity-preview-05-2026). model: Model name for agent_config (e.g. gemini-3.6-flash, gemini-3.5-flash-lite). environment: Sandbox environment mode ('remote' or existing environment_id). tools: List of custom tool dicts (code_execution, google_search, url_context, mcp_server, function). images: Optional list of base64 images, e.g. [{"data": "", "mime_type": "image/png"}]. max_total_tokens: Optional token budget cap for the interaction. background: Run asynchronously; poll with get_interaction_status. Forces store=True. system_instruction: Optional behavior/persona override for this interaction. stream: Stream the response via the SDK (ignored by the REST fallback path).
Inputs: prompt (required), agent, model, tools, +6 more. Returns: result
create_managed_agentA
Register a reusable named agent (invoke later via create_interaction(agent=agent_id)).
Args: agent_id: Unique identifier. Cannot start with reserved prefixes (antigravity-, gemini-, google-, etc). model: Model for agent_config (default gemini-3.6-flash). system_instruction: Persistent persona/behavior definition. tools: Default tools; falls back to code_execution, google_search, url_context if omitted. base_environment: Environment string/id or config dict (see build_environment_config); forked per invocation. description: Human-readable description.
Inputs: agent_id (required), model, tools, description, +2 more. Returns: result
create_triggerA
Create a cron-scheduled trigger that runs an Antigravity interaction on a recurring schedule.
Args: schedule: Cron expression, e.g. "0 9 * * *". prompt: Task instruction the agent runs on each execution. time_zone: IANA time zone, e.g. "America/Argentina/Buenos_Aires". display_name: Human-readable trigger name. agent: Agent identifier. environment: Sandbox environment mode ('remote' or existing environment_id). max_consecutive_failures: Auto-pause trigger after N consecutive failures. execution_timeout_seconds: Per-execution timeout.
Inputs: prompt (required), schedule (required), agent, time_zone, +4 more. Returns: result
delete_environmentADestructiveIdempotent
Terminate and remove a sandbox environment's resources.
Inputs: environment_id (required). Returns: result
delete_interactionCDestructiveIdempotent
Delete a stored interaction.
Inputs: interaction_id (required). Returns: result
delete_managed_agentADestructiveIdempotent
Delete a managed agent's registration (existing environments/interactions persist).
Inputs: agent_id (required). Returns: result
delete_triggerBDestructiveIdempotent
Permanently delete a trigger.
Inputs: trigger_id (required). Returns: result
download_environment_filesARead-only
Download the full sandbox filesystem as a .tar archive to a local path.
Args: environment_id: Environment to snapshot. dest_path: Local filesystem path to write the .tar archive to.
Inputs: dest_path (required), environment_id (required). Returns: result
get_environmentARead-onlyIdempotent
Fetch a sandbox environment's details (type, sources, network config).
Inputs: environment_id (required). Returns: result
get_interaction_statusBRead-onlyIdempotent
Get status and current steps of an interaction.
Inputs: interaction_id (required). Returns: result
get_managed_agentBRead-onlyIdempotent
Fetch a managed agent's stored configuration.
Inputs: agent_id (required). Returns: result
get_triggerARead-onlyIdempotent
Fetch a single trigger by ID.
Inputs: trigger_id (required). Returns: result
list_environmentsCRead-onlyIdempotent
List sandbox environments in the project.
Inputs: page_size, page_token. Returns: result
list_interactionsARead-onlyIdempotent
List cached interaction sessions and their current status, newest first.
Args: page_size: Max sessions to return (default 50). page_token: Offset into the cache to resume from; pass back the returned "next_page_token".
Inputs: page_size, page_token. Returns: result
list_managed_agentsBRead-onlyIdempotent
List all registered managed agents in the project.
Inputs: page_size, page_token. Returns: result
list_trigger_executionsBRead-onlyIdempotent
View execution history for a trigger.
Inputs: trigger_id (required). Returns: result
list_triggersBRead-onlyIdempotent
List all cron triggers.
Inputs: page_size, page_token. Returns: result
run_triggerC
Execute a trigger immediately, outside its schedule.
Inputs: trigger_id (required). Returns: result
submit_function_resultB
Submit a local function execution result back to a pending interaction (requires_action status).
Inputs: result (required), call_id (required), function_name (required), environment_id (required), +2 more. Returns: result
update_trigger_statusBIdempotent
Pause or resume a trigger. status: 'active' or 'paused'.
Inputs: status (required), trigger_id (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Tools are clearly organized into distinct categories (interactions, triggers, managed agents, environments, helpers) with no overlapping purposes. Even similar tools like create_interaction and continue_interaction are well-differentiated.
All tools follow a consistent verb_noun snake_case pattern, making them predictable and easy to navigate. Even longer names like build_mcp_server_tool_config adhere to this convention.
At 27 tools, the set is extensive but justified given the server's broad scope covering interactions, triggers, agents, environments, and configuration helpers. Each tool serves a clear purpose without redundancy.
The server provides comprehensive CRUD-like coverage for each domain: interactions (create, continue, submit, get status, cancel, delete, list), triggers (create, list, update status, delete, run, list executions), managed agents, and environments, plus helper tools for building configs.
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Official MCP server for Agentwork — delegate tasks to AI agents with human-in-the-loop
An MCP server that provides agents access to the KeldynAI platform
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that gives your IDE or agent access to Google Gemini with autonomous codebase exploration, enabling deep code analysis, architectural reviews, and bug hunting.2010MIT
- AlicenseAqualityCmaintenanceAn advanced MCP server that provides an agentic interface to Google's Gemini 3.1 models via Vertex AI, combining real-time Google Search, URL analysis, and Python code execution to solve complex multi-step research and data tasks.1MIT
- AlicenseNot gradedqualityAmaintenanceMCP server enabling delegation of tasks to the Antigravity (Gemini) CLI from any AI client supporting MCP.8 npmMIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that leverages Google Antigravity SDK and Gemini Enterprise Agent Platform to provide AI-driven code review and task execution via natural language.1-