Content
# agymcp
Wraps [Antigravity CLI (agy)](https://antigravity.dev) as MCP Server for clients that support MCP protocol, such as Claude Code.
## Prerequisites
- [Antigravity CLI](https://antigravity.dev) is installed and logged in (`agy` command is available in PATH)
- [uv](https://github.com/astral-sh/uv) is installed (for uvx pulling and running)
## Installation
Add the following to `mcpServers` in `~/.claude.json`:
```json
{
"mcpServers": {
"agy": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/leologoli/agymcp.git",
"agymcp"
],
"env": {},
"type": "stdio"
}
}
}
```
Restart Claude Code to take effect. The first startup will automatically pull and install dependencies.
## Tool Description
### `agy`
Calls Antigravity CLI to execute AI tasks, returns model response text and session ID.
**Parameters:**
| Parameter | Type | Required | Description |
|------|------|------|------|
| `PROMPT` | string | ✅ | Task instruction sent to Antigravity |
| `cd` | path | ✅ | Working directory (workspace root) when executing tasks |
| `SESSION_ID` | string | ❌ | Conversation session ID, empty to start a new session |
| `sandbox` | bool | ❌ | Whether to enable sandbox mode, default false |
| `model` | string | ❌ | Specify model, leave empty to use default model |
**Returns:**
| Field | Description |
|------|------|
| `success` | Whether successful |
| `SESSION_ID` | Session UUID, pass to next call to continue conversation |
| `agent_messages` | Model response text |
| `error` | Error description when failed |
**Example:**
```json
// New session
{
"PROMPT": "Introduce yourself in one sentence",
"cd": "/path/to/project"
}
// Continue conversation
{
"PROMPT": "What did I ask you last time?",
"cd": "/path/to/project",
"SESSION_ID": "56540478-7163-4d90-a476-f2487c81aa6a"
}
```
## Implementation Principle
1. Run `agy` in `--print` mode, write logs to a temporary file using `--log-file`
2. Extract `conversation UUID` as `SESSION_ID` from logs using regular expressions
3. Restore context using `--conversation <SESSION_ID>` parameter when continuing conversation
4. Implement stdio transmission based on [FastMCP](https://github.com/jlowin/fastmcp)
## License
MIT