Skip to main content
Glama

agy-mcp-server

CI License: MIT Node.js MCP Platform

Languages: English | Português

An MCP server that exposes the Antigravity CLI (agy) to MCP clients such as OpenCode. It provides structured tools for planning, code review, test validation, generic prompts, and literal CLI commands.

The server is intentionally restricted to Google Gemini models and defaults to gemini-3.7-flash-medium.

Important: This project requires the official agy CLI to be installed and authenticated. It does not provide or redistribute Antigravity credentials or the CLI itself.

Features

  • MCP server over stdio for local clients

  • agy_plan for architecture and implementation plans

  • agy_review for technical and security-oriented code review

  • agy_validate_tests for test quality and coverage analysis

  • agy_exec for general-purpose Antigravity prompts

  • agy_command for literal slash commands such as /usage

  • Strict allowlist for Google Gemini models

  • Safe argument passing through spawn, without shell interpolation

  • Configurable project context through directory

  • Five-minute execution timeout with graceful termination and force-kill fallback

  • English tool descriptions and error messages

Related MCP server: antigravity-mcp

Requirements

  • Node.js 20 or later

  • npm

  • The agy CLI installed and authenticated

  • An MCP-compatible client

By default, the server looks for agy at ~/.local/bin/agy. Set AGY_BIN_PATH when it is installed elsewhere.

Installation

git clone https://github.com/moisesfilho/agy-mcp-server.git
cd agy-mcp-server
npm ci
npm run build

OpenCode Configuration

Add the following entry to ~/.config/opencode/opencode.json:

{
  "mcp": {
    "agy-proxy": {
      "type": "local",
      "command": [
        "node",
        "/absolute/path/to/agy-mcp-server/dist/index.js"
      ]
    }
  }
}

For a local installation in the standard project directory, use:

{
  "mcp": {
    "agy-proxy": {
      "type": "local",
      "command": [
        "node",
        "/home/moises/Projetos/agy-mcp-server/dist/index.js"
      ]
    }
  }
}

Restart the MCP client after changing its configuration.

Available Models

Every tool accepts an optional model argument. Only the following models are accepted:

Model

Default

gemini-3.7-flash-medium

Yes

gemini-3.7-flash-high

No

gemini-3.7-flash-low

No

gemini-3.8-flash-high

No

gemini-3.8-flash-medium

No

gemini-3.8-flash-low

No

gemini-3.6-flash-high

No

gemini-3.6-flash-medium

No

gemini-3.6-flash-low

No

gemini-3.1-pro-high

No

gemini-3.1-pro-low

No

The model suffix controls the reasoning effort. The server does not send a separate --effort flag because the agy CLI rejects conflicting combinations.

Usage

Ask the MCP client to use a tool. Examples:

Create a plan

Use agy_plan to create an implementation plan for adding PostgreSQL caching to this project.

Tool arguments:

{
  "prompt": "Create an implementation plan for adding PostgreSQL caching.",
  "directory": "/home/moises/Projetos/my-project",
  "model": "gemini-3.7-flash-medium"
}

Review code

Use agy_review to inspect the current changes for security issues and regressions.

Validate tests

Use agy_validate_tests to identify missing edge cases in the current test suite.

Run a direct CLI command

Use agy_command when the input must reach agy literally, without an LLM interpreting it:

{
  "command": "/usage"
}

This is equivalent to:

agy -p /usage --output-format text

Other slash commands can be sent in the same way, provided they are supported by the installed agy version.

Run a general prompt

{
  "prompt": "Analyze the current architecture and identify the three largest reliability risks.",
  "mode": "plan",
  "directory": "/home/moises/Projetos/my-project",
  "model": "gemini-3.7-flash-high"
}

Configuration

Variable

Default

Description

AGY_BIN_PATH

~/.local/bin/agy

Absolute path to the agy executable

The server does not store credentials. Authentication is handled by the local agy installation and its own configuration.

Security Notes

  • The server passes arguments directly to the child process and does not invoke a shell.

  • agy is started with --dangerously-skip-permissions, as required for unattended MCP calls. Review prompts and workspace permissions before using agy_exec with edit-capable modes.

  • Directory paths are supplied as process arguments and used as the child working directory.

  • Model validation rejects non-Gemini model names before starting agy.

  • Do not commit agy credentials, local configuration files, or environment secrets.

Project Structure

src/
├── config.ts                 # Binary resolution and Gemini allowlist
├── index.ts                  # MCP stdio server entry point
├── runner.ts                 # agy process lifecycle and timeout handling
└── tools/
    ├── command.ts            # Literal slash commands
    ├── exec.ts               # Generic prompts
    ├── plan.ts               # Technical planning
    ├── review.ts             # Code review
    └── validate-tests.ts     # Test analysis

Development

npm install
npm run typecheck
npm run build
npm start

The server communicates through stdin/stdout using MCP JSON-RPC. Diagnostic messages are written to stderr.

License

This project is licensed under the MIT License. See LICENSE.

Available Tools

5 tools
agy_commandB

Executa literalmente um comando direto do Antigravity CLI, como /usage, sem pedir ao modelo para interpretar ou reformular a instrução.

Inputs: command (required), model, directory.

agy_execC

Executa comandos genéricos ou consultas arbitrárias via Antigravity (agy CLI) com suporte a modelos Google Gemini.

Inputs: prompt (required), mode, model, directory.

agy_planC

Gera ou valida planos de arquitetura e implementação técnica utilizando o Antigravity (agy CLI) em modo de planejamento.

Inputs: prompt (required), model, directory.

agy_reviewB

Realiza revisão técnica aprofundada de código, diffs ou implementações via Antigravity (agy CLI), avaliando manutenibilidade, segurança, performance e possíveis bugs.

Inputs: prompt (required), model, directory.

agy_validate_testsC

Analisa código de teste e de produção via Antigravity (agy CLI) para identificar asserções frágeis, casos de borda não cobertos, vazamento de estado e robustez da suíte.

Inputs: prompt (required), model, directory.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 5 tools

    Disambiguation4/5

    Most tools target distinct tasks: agy_plan for planning, agy_review for code review, and agy_validate_tests for test analysis are clearly separable. The main ambiguity is between agy_exec and agy_command, which both execute commands via the CLI; the descriptions distinguish model-interpreted vs. literal execution, but the boundary is subtle enough to risk occasional misselection.

    Naming Consistency3/5

    All tools share the predictable agy_ prefix and snake_case, which helps grouping. However, the suffixes mix conventions: agy_plan and agy_command are noun-like, while agy_validate_tests and agy_review are verb phrases, and agy_exec is an abbreviation, so there is no single consistent verb_noun pattern.

    Tool Count5/5

    Five tools is a well-scoped set for an Antigravity CLI wrapper, covering planning, review, test validation, generic execution, and direct command invocation without redundant bulk.

    Completeness4/5

    The surface covers the main modes of interacting with the agy CLI: planning, code review, test analysis, generic execution, and literal command execution. Minor gaps like explicit model/config listing or session management could exist, but core workflows appear covered.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      26 npm
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables MCP-compatible AI clients like Claude Code, Cursor, and Codex to invoke Google Antigravity's Gemini coding agent for repository-aware file operations, command execution, code review, test generation, and quota checks, while also providing a standalone dual-mode CLI.
      7
      MIT