antigravity-cli-mcp
MCP server wrapping the agy CLI, enabling querying, web search, and file writing through tools like ask-agy, search-web, and write-file.
README
antigravity-cli-mcp
An MCP (Model Context Protocol) server wrapping the agy (antigravity) CLI. This server exposes the capabilities of the agy tool to MCP clients like Claude Code, Codex, OpenCode, Cline, Kilocode, Kilo, and other stdio JSON-RPC compatible LLM interfaces.
Features
- Exposes 4 core tools:
ping,ask-agy,search-web, andwrite-file. - Manages subprocess execution using Bun's fast
Bun.spawnengine. - Implements concurrency limits and resource constraints (timeout, max memory/output bytes, workspace directory confinement).
- Emits real-time streaming progress notifications back to the LLM client using MCP
notifications/progressprotocol. - Strict path validation to ensure file access does not escape the workspace.
Verified Integrations
| Client | Verified |
|---|---|
| Claude Code | ✓ |
| Codex CLI | ✓ |
| OpenCode | ✓ |
| Cline | ✓ |
| Kilo CLI | ✓ |
Installation & Registration
Prerequisites
- Bun (v1.0.0 or higher) installed.
- agy (antigravity CLI) binary installed on your system.
Installation
- Install globally via npm/bun:
npm install -g antigravity-cli-mcp
# or
bun add -g antigravity-cli-mcp
- Or use directly with npx/bunx without installing:
npx antigravity-cli-mcp
# or
bunx antigravity-cli-mcp
Registering with Claude Code
# Using npm (after global install or via npx)
claude mcp add antigravity-cli-mcp -- npx antigravity-cli-mcp
# Development mode (from source)
claude mcp add antigravity-cli-mcp -- bun /path/to/antigravity-cli-mcp/src/index.ts
Registering with Codex CLI
Option A: Project-scoped Config (Automatic)
Codex will automatically load the server if you start it from inside this project directory, thanks to the included .codex/config.toml file:
[mcp_servers.antigravity-cli-mcp]
command = "bun"
args = ["src/index.ts"]
Option B: Global CLI Registration
To register the server globally so it is available across all directories:
# Using npm (after global install or via npx)
codex mcp add antigravity-cli-mcp -- npx antigravity-cli-mcp
# Development mode (from source)
codex mcp add antigravity-cli-mcp -- bun /path/to/antigravity-cli-mcp/src/index.ts
Registering with Cline / Kilocode
[!NOTE] This section is for the Kilocode VS Code extension (
kilocode.kilo-code). If you are using the standalone Kilo CLI tool, please refer to the Registering with Kilo section.
Cline and Kilocode store MCP server config in a cline_mcp_settings.json file inside their VS Code extension's global storage directory.
Cline (saoudrizwan.claude-dev):
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Kilocode (kilocode.kilo-code):
~/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code/settings/cline_mcp_settings.json
Add the following entry to the mcpServers object in the appropriate file:
Using npm (after global install or via npx):
{
"mcpServers": {
"antigravity-cli-mcp": {
"command": "npx",
"args": ["-y", "antigravity-cli-mcp"],
"disabled": false,
"autoApprove": []
}
}
}
Development mode (from source):
{
"mcpServers": {
"antigravity-cli-mcp": {
"command": "bun",
"args": ["/path/to/antigravity-cli-mcp/src/index.ts"],
"disabled": false,
"autoApprove": []
}
}
}
Replace /path/to/antigravity-cli-mcp with the absolute path to this repository. After saving, reload the VS Code window (Cmd+Shift+P → Developer: Reload Window) for the changes to take effect.
Registering with Kilo
Kilo is a standalone CLI tool installed at /opt/homebrew/bin/kilo (separate from the Kilocode VS Code extension).
To register the server with Kilo:
# Using npm (after global install or via npx)
kilo mcp add antigravity-cli-mcp -- npx antigravity-cli-mcp
# Development mode (from source)
kilo mcp add antigravity-cli-mcp -- bun /path/to/antigravity-cli-mcp/src/index.ts
Verification
Verify that the server has been added successfully:
kilo mcp list
Registering with OpenCode
Add to ~/.opencode/opencode.json (OpenCode reads global config from there):
Using npm (after global install or via npx):
{
"mcp": {
"antigravity-cli-mcp": {
"type": "local",
"command": ["npx", "-y", "antigravity-cli-mcp"]
}
}
}
Development mode (from source):
{
"mcp": {
"antigravity-cli-mcp": {
"type": "local",
"command": ["bun", "/path/to/antigravity-cli-mcp/src/index.ts"]
}
}
}
Verify with:
opencode mcp list
# antigravity-cli-mcp connected
Configuration
You can configure the MCP server by setting the following environment variables:
| Environment Variable | Default Value | Description |
|---|---|---|
AGY_PATH |
~/.local/bin/agy |
The absolute path to the agy CLI binary. |
AGY_TIMEOUT_MS |
300000 (5 minutes) |
Timeout in milliseconds for general ask-agy prompts. |
AGY_SEARCH_TIMEOUT_MS |
60000 (1 minute) |
Timeout in milliseconds specifically for search-web queries. |
AGY_WORKSPACE_ROOT |
process.cwd() |
The root directory for file validation and execution context. |
AGY_MAX_CONCURRENT |
3 |
Maximum number of concurrent agy processes allowed to run. |
AGY_MAX_OUTPUT_BYTES |
1000000 (1MB) |
Maximum stdout size allowed from agy before truncating. |
AGY_DEBUG |
0 (or unset) |
Set to 1 to enable verbose debugging logs on stderr. |
Tools
The server registers 4 MCP tools:
1. ping
- Description: Check
agyhealth, version, binary path, and active workspace root. - Input Schema:
{}(none) - Response: Details of the
agybinary version and execution capabilities.
2. ask-agy
- Description: Runs a prompt non-interactively with
agy. - Input Schema:
prompt(string, max 10k chars): The prompt to send toagy.cwd(string, optional): Override the working directory.timeout_ms(integer, optional): Override default execution timeout.add_dirs(array of strings, optional): Extra directories to register for prompt context.skip_permissions(boolean, optional): Skip safety/permission prompts by adding--dangerously-skip-permissionsto the binary invocation.
3. search-web
- Description: Perform web search queries via
agy. Results come fromagy's search integration. - Input Schema:
query(string, max 500 chars): The search query.
4. write-file
- Description: Write exact text content to a file inside the workspace root (does not call the
agybinary). - Input Schema:
path(string): The destination path (relative to the workspace root).content(string, max 500k chars): The content to write.create_parents(boolean, defaultfalse): If true, creates parent directories if they don't exist.
Streaming / Progress Notifications
For long-running CLI invocations, the ask-agy and search-web tools support progress updates. When an MCP client provides a progressToken in the tool call metadata:
- The server listens to the raw stdout chunks from
Bun.spawn(). - It sends
notifications/progressJSON-RPC updates containing the token, incremental sequence number, and the raw text output chunk as the message. - This allows compatible clients (such as Claude Code) to render output dynamically to the user while
agyis still processing.
Development
All standard lifecycle scripts are managed through bun:
Running Tests
Execute the unit and integration test suite:
bun test
Type Checking
Validate the TypeScript codebase:
bun run typecheck
Building the Project
Compile the TypeScript code into a single executable bundle at dist/index.js:
bun run build
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Getting Started
-
Clone the repository:
git clone git@github.com:nadimtuhin/antigravity-cli-mcp.git cd antigravity-cli-mcp -
Install dependencies:
bun install
Quality & Build Verification
Before submitting your PR, please verify your changes:
- Run tests:
bun test - Typecheck code:
bun run typecheck - Build the project:
bun run build
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。