Skip to main content
Glama
agy-mcp-server

agy-mcp-server

by HackerWilson

agy-mcp-server

一个零第三方 Python 运行依赖的 MCP stdio 服务,用于调用本机 agy CLI。支持同步执行、 超时自动转后台任务、会话续跑,以及任务状态和结果查询。

要求

  • Python 3.9+

  • macOS 或 Linux

  • 已安装并能独立运行的 agy

服务不会读取或复制 OAuth token;认证由 agy 自身完成。

Related MCP server: antigravity-mcp

安装

直接使用源码:

git clone https://github.com/HackerWilson/agy-mcp-server.git
cd agy-mcp-server
python3 server.py

也可以安装命令行入口:

pipx install git+https://github.com/HackerWilson/agy-mcp-server.git
# 或
uv tool install git+https://github.com/HackerWilson/agy-mcp-server.git

配置

使用源码:

{
  "mcpServers": {
    "antigravity": {
      "command": "python3",
      "args": ["/absolute/path/to/agy-mcp-server/server.py"]
    }
  }
}

使用 pipx 或 uv tool 安装后:

{
  "mcpServers": {
    "antigravity": {
      "command": "agy-mcp-server",
      "args": []
    }
  }
}

MCP stdio 服务由客户端按需启动,并通过标准输入输出通信。直接执行后没有终端提示、一直等待 输入属于正常现象;客户端关闭连接后,服务进程也会退出。

如果客户端的环境变量中找不到 agy,可以显式指定路径:

{
  "env": {
    "ANTIGRAVITY_MCP_AGY_PATH": "/absolute/path/to/agy"
  }
}

工具

  • run_antigravity:同步执行新任务,达到等待阈值后返回后台 Job。

  • antigravity_continue:续跑已有会话,同样支持超时降级。

  • antigravity_start:直接启动异步任务。

  • antigravity_job_status、antigravity_job_result、antigravity_job_cancel:管理后台任务。

  • antigravity_sessions、antigravity_transcript:读取本机历史会话和执行轨迹。

  • antigravity_doctor、antigravity_models:环境诊断和模型列表。

read_only=true 会启用 agy --sandbox,但这不是严格的文件系统只读保证。 yolo=true 会传递 --dangerously-skip-permissions,仅应在可信工作目录中使用。 timeout_seconds 只控制同步工具等待多久后返回后台 Job;print_timeout_seconds 控制 agy 任务本身的最长执行时间,默认为 3600 秒,可设置为 60–86400 秒。 续跑时可以传入完整会话 ID,也可以传入至少 8 位的十六进制前缀;短前缀只有在本机会话 数据库中唯一匹配时才会展开。完整 UUID 在本机数据库中不存在时会拒绝启动,避免 agy 忽略 --conversation 后静默创建新会话。任务完成后,状态和结果会分别显示请求/实际会话 ID、续跑判定和 turn 数。 agy 要求 prompt 作为 -p 的命令行参数;运行期间,本机同一用户的进程查看工具可能看到 prompt,因此不要在任务文本中直接放置密码或 token。单次 prompt 上限为 120 KiB。

Job 状态默认保存在 ~/.gemini/antigravity-mcp/jobs。目录权限为 0700,文件权限为 0600;可通过 ANTIGRAVITY_MCP_JOBS_DIR 修改位置。

更新与卸载

# 源码安装
git -C /path/to/agy-mcp-server pull --ff-only

# pipx
pipx upgrade agy-mcp-server
pipx uninstall agy-mcp-server

# uv
uv tool upgrade agy-mcp-server
uv tool uninstall agy-mcp-server

源码更新不会热替换已经运行的 stdio MCP 进程;更新后需要让 MCP Client 断开并重新创建该 进程。若客户端会缓存失败或已断开的 MCP 通道,则需要重启客户端应用。

测试

python3 -m unittest -v

测试使用临时 fake agy,不会访问网络、读取认证信息或消耗模型额度。

参考

Available Tools

10 tools
antigravity_continueA

CONTINUE an existing Antigravity conversation by ID. Synchronous execution with a bounded timeout guard (auto-converts to a background job if still running). Supports YOLO autonomous execution or lightweight terminal sandboxing.

Inputs: prompt (required), conversation_id (required), yolo, model, +4 more.

antigravity_doctorA

Diagnose Antigravity CLI health, authentication token status, YOLO permission mode, and storage metrics.

Inputs: no named parameters.

antigravity_job_cancelA

Cancel or kill an ongoing background Antigravity job by ID.

Inputs: job_id (required).

antigravity_job_resultA

Fetch the full execution report and final output of a background job once completed. Returns status, duration, full step trajectory, and final answer.

Inputs: job_id (required).

antigravity_job_statusA

Check the real-time progress and live step status of a background job. Fast local query (returns in < 20ms). Shows elapsed time, process alive status, and latest tool execution actions.

Inputs: job_id (required).

antigravity_modelsA

List available models supported by this Antigravity installation.

Inputs: no named parameters.

antigravity_sessionsA

List or search historical Antigravity sessions from local database (fast, zero model cost). Returns session IDs, summaries, step counts, and last modified times. Use this to find a conversation ID to resume.

Inputs: limit, query.

antigravity_startA

Submit an asynchronous task to Antigravity and return a job ID without waiting for model completion. Use this for long-running tasks (e.g. multi-minute analyses, large refactors). Supports both new tasks and continuing existing sessions (if conversation_id is provided).

Inputs: prompt (required), yolo, model, work_dir, +3 more.

antigravity_transcriptA

Read the detailed execution transcript of any past or current Antigravity session by ID. Fast local read (zero token cost). Returns the step-by-step history of user prompts, tools executed, command outputs, and conclusions.

Inputs: conversation_id (required), max_steps, only_final.

run_antigravityA

Start a NEW task using Google Antigravity AI Agent (agy). Synchronous execution with a bounded timeout guard (auto-converts to a background job if still running). Supports YOLO autonomous execution or lightweight terminal sandboxing.

Inputs: prompt (required), yolo, model, work_dir, +3 more.

Tool Schema Changelog

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

    TDQS

    A4.1/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a distinct purpose: starting new tasks, continuing sessions, submitting async jobs, checking status, fetching results, canceling, listing sessions, diagnosing, reading transcripts, and listing models. There is no ambiguity between them.

    Naming Consistency4/5

    The majority follow the 'antigravity_' prefix pattern with verb suffixes (e.g., antigravity_continue, antigravity_start). The one exception is 'run_antigravity', which inverts the order but remains clear. Overall, the naming is predictable and readable.

    Tool Count5/5

    With 10 tools, the server is well-scoped for managing Antigravity agent tasks. Each tool serves a necessary function, covering execution, monitoring, history, diagnostics, and model discovery without bloat.

    Completeness5/5

    The toolset covers the full lifecycle of agent tasks: starting (sync/async), continuing, checking status, retrieving results, canceling, listing sessions, reading transcripts, and diagnosing the environment. No critical gaps are apparent for the intended domain.

    Maintenance

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Durable MCP server for managing long-running jobs locally, over SSH, or on Slurm clusters. Jobs survive client disconnects and return exit codes, bounded logs, and JSON artifacts.
      11
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables MCP clients such as Claude Code, Codex, and Cursor to dispatch background subagent jobs to the Antigravity IDE's local agent engine and collect results asynchronously. Jobs run through the IDE's authenticated session without an API key, with optional Gemini REST fallback and on-disk job history.
      6
      2
      MIT