agy MCP Server
Enables Claude to drive the Antigravity agent by running prompts through the agy CLI non-interactively, supporting session management and optional sandboxed execution.
README
agy MCP Server
Bridge between Claude and Google Antigravity's agy CLI — let Claude Code (or any MCP client) drive the Antigravity agent through tool calls.
graph LR
A[Claude Code] --> B[agy MCP Server]
B --> C[agy CLI]
C --> D[Antigravity / Gemini]
style A fill:#FF6B35
style B fill:#4A90E2
style C fill:#00D4AA
style D fill:#FFA500
This project mirrors the architecture of codex-mcp-server but wraps agy instead of codex.
How it works
agy exposes a non-interactive print mode: agy -p "<prompt>" runs a single
prompt (the prompt is the value of -p) and prints the response to stdout.
This server spawns agy -p "<prompt>" with the prompt as an argument, always
closes stdin so agy never blocks waiting for input, and returns stdout as the
MCP tool result. (agy only reads the prompt from stdin when -p is empty; a
bare -p with no value errors with "flag needs an argument".)
Requirements
agyCLI v1.0.3+ on yourPATH(agy --version). It ships with Google Antigravity.- You must be logged into Antigravity —
agyreuses the desktop app's credentials, so there is no API key to configure here.
Install
Prerequisite (all methods): the
agyCLI (v1.0.3+) must be installed and logged into Antigravity on the machine that runs the MCP server.
A) Via GitHub + npx (no manual clone)
claude mcp add agy-cli -- npx -y github:toonPt0473/agy-mcp-server
npx clones the repo and runs the prepare script (tsc) to build dist/ on
first install, then launches the server. Requires git and Node on PATH.
Updates: bump the repo; npx re-fetches on the next cold install (or clear the npx cache).
B) From a local clone
git clone https://github.com/toonPt0473/agy-mcp-server.git
cd agy-mcp-server
npm install # runs the build automatically via the `prepare` script
claude mcp add agy-cli -- node "$(pwd)/dist/index.js"
C) Global binary (decoupled from the source folder)
npm install -g . # in the cloned repo; exposes the `agy-mcp-server` bin
claude mcp add agy-cli -- agy-mcp-server
This repo also ships a project-scoped .mcp.json pointing at dist/index.js,
which Claude Code picks up automatically when run from the project directory.
Tools
| Tool | Description |
|---|---|
agy |
Run a prompt through agy -p (print mode) with optional session continuation, extra dirs, sandbox, and skip-permissions |
listSessions |
View active conversation sessions |
ping |
Test server connection |
help |
Get agy --help output |
changelog |
Show agy changelog / release notes |
agy tool parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt |
string | — (required) | The task/question. Passed as the value of agy -p. |
sessionId |
string | — | Multi-turn context. First turn = fresh conversation; later turns continue it. |
resetSession |
boolean | false |
Start a fresh conversation for this session. |
conversationId |
string | — | Resume a specific agy conversation (--conversation <id>). |
continueConversation |
boolean | false |
Force agy --continue (most recent conversation). |
addDirs |
string[] | — | Extra workspace dirs (--add-dir, repeatable). |
sandbox |
boolean | false |
--sandbox (terminal restrictions). |
skipPermissions |
boolean | false |
⚠️ --dangerously-skip-permissions — auto-approve all tool use. Needed for agy to run tools unattended. |
printTimeout |
string | 5m |
--print-timeout (Go duration, e.g. 90s, 1h30m). |
Examples
Use agy to explain the auth flow in this repo
Use agy with sessionId "refactor" to analyze this module
Use agy with sessionId "refactor" to now implement the change # continues the same conversation
Use agy with skipPermissions true and addDirs ["./src"] to refactor and write files
Session model & limitations
agyprint mode does not emit a conversation ID, so multi-turn within asessionIdusesagy --continue(continue the most recent conversation).- Because "most recent" is global to
agy, avoid interleaving multiple sessions or runningagymanually in the middle of a session — the continuation could attach to the wrong conversation. For precise resume, pass aconversationIdyou obtained from the Antigravity app. - Without
skipPermissions: true, a prompt that makesagywant to use a tool may block untilprintTimeout, since approvals can't be given non-interactively. UseskipPermissionsfor agentic/file-writing tasks; leave it off for Q&A.
Environment variables
AGY_BIN— path to theagybinary (default:agyonPATH).AGY_MCP_PRINT_TIMEOUT— default--print-timeoutwhen not set per-call (default5m).AGY_MCP_LOG_DIR— enable conversation logging into this directory (see below).AGY_MCP_LOG_FILE— enable conversation logging into this single file (overridesAGY_MCP_LOG_DIR).STRUCTURED_CONTENT_ENABLED— emitstructuredContentin results (1/true/yes/on). Off by default;_metais always included for Claude Code.
Conversation logging
Every agy tool call (the prompt Claude sent and the response agy returned)
can be appended to a Markdown transcript. Logging is off by default;
enable it by setting one of:
AGY_MCP_LOG_DIR=/path/to/dir→ one file per day:agy-conversations-YYYY-MM-DD.mdAGY_MCP_LOG_FILE=/path/to/file.md→ a single file (takes precedence)
Set it in the env block of your .mcp.json, e.g.:
{
"mcpServers": {
"agy-cli": {
"type": "stdio",
"command": "npx",
"args": ["-y", "github:toonPt0473/agy-mcp-server"],
"env": { "AGY_MCP_LOG_DIR": "/abs/path/to/project/.agy-logs" }
}
}
}
Each entry records the timestamp, mode (fresh/continue/resume), sessionId,
conversationId, duration, flags (sandbox/skipPermissions/addDirs), and the full
prompt and response. Logging failures are reported to stderr but never break the
tool. Add the log directory to .gitignore if you don't want transcripts committed.
Development
npm install # install dependencies
npm run dev # run from source with tsx
npm run build # compile to dist/
npm test # run the test suite
npm run lint # eslint
npm run format # prettier
License
ISC
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。