Skip to main content
Glama
JacksonFuck

Antigravity Mobile Command MCP Server

by JacksonFuck
README.md
# šŸš€ Antigravity Mobile Command

**Transform your mobile device into a remote Mission Control for your coding environment.**

Antigravity Mobile Command is an "Agentic Bridge" that leverages Google Antigravity's native Model Context Protocol (MCP) and Artifact system to provide a bi-directional, real-time feedback loop via Telegram.

![Telegram Bot Preview](docs/preview.png)

## ✨ Features

- **šŸ“± Prompt-to-Action Loop**: Send coding tasks from your phone, approve plans with inline buttons
- **šŸ“ø Visual Verification**: Auto-receive screenshots and recordings of UI changes
- **āœ… Interactive Governance**: Approve or reject code diffs via Telegram buttons
- **🚨 Error Awareness**: Get notified of terminal crashes with full stack traces
- **šŸ“Š Live Status Ticker**: Real-time progress updates without message spam

## šŸ› ļø Quick Start

### Prerequisites

- Python 3.10+
- A Telegram Bot Token (from [@BotFather](https://t.me/BotFather))
- Your Telegram Chat ID (from [@userinfobot](https://t.me/userinfobot))

### Installation

```bash
# Clone the repository
git clone https://github.com/yourusername/antigravity-telegram.git
cd antigravity-telegram

# Install dependencies
pip install -e .

# Or with uv
uv pip install -e .
```

### Configuration

1. Copy the example environment file:
```bash
cp .env.example .env
```

2. Edit `.env` with your credentials:
```bash
TELEGRAM_BOT_TOKEN=your_bot_token_from_botfather
AUTHORIZED_CHAT_IDS=your_chat_id
ARTIFACTS_PATH=~/.gemini/antigravity/artifacts
```

### Running

**Run both Telegram bot and MCP server:**
```bash
python -m src.main
```

**Run only the Telegram bot:**
```bash
python -m src.main --mode bot
```

**Run only the MCP server (for Antigravity integration):**
```bash
python -m src.main --mode mcp
```

## šŸ”Œ Antigravity MCP Integration

### 1. Add to MCP Config

Add the Telegram bridge to your Antigravity MCP configuration (`~/.gemini/mcp_config.json`):

```json
{
  "mcpServers": {
    "telegram-bridge": {
      "command": "python",
      "args": ["-m", "src.main", "--mode", "mcp"],
      "cwd": "/path/to/antigravity-telegram",
      "env": {
        "TELEGRAM_BOT_TOKEN": "your_token",
        "AUTHORIZED_CHAT_IDS": "your_chat_id",
        "ARTIFACTS_PATH": "~/.gemini/antigravity/artifacts"
      }
    }
  }
}
```

### 2. Copy the Workflow

Copy the workflow file to your Antigravity workflows:
```bash
cp workflows/mobile-command.md ~/.agent/workflows/
```

### 3. Use from Telegram

1. Start a chat with your bot on Telegram
2. Send `/start` to verify the connection
3. Send `/prompt "Your coding task here"`
4. Approve plans and review changes from your phone!

## šŸ“± Telegram Commands

| Command | Description |
|---------|-------------|
| `/start` | Show welcome message and verify connection |
| `/prompt <text>` | Send a coding task to Antigravity |
| `/status` | Check current execution status |
| `/cancel` | Cancel the current operation |
| `/help` | Show help message |

## šŸ”§ MCP Tools Available

The following tools are exposed to Antigravity for communication:

| Tool | Description |
|------|-------------|
| `send_telegram_message` | Send messages to the user |
| `request_plan_approval` | Request approval for implementation plans |
| `request_change_approval` | Request approval for code changes |
| `send_artifact` | Send screenshots/recordings to Telegram |
| `update_status` | Update the status ticker message |
| `notify_error` | Send critical error notifications |
| `await_user_response` | Wait for user input |

## šŸ—ļø Architecture

```
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”     ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”     ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│  šŸ“± Telegram    │◄───►│  šŸŒ‰ Python       │◄───►│  🌌 Antigravity │
│     App         │     │     Bridge       │     │     Agent       │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜     ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜     ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
                               │
                               ā–¼
                        ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
                        │  šŸ“ Artifact     │
                        │     Watcher      │
                        ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
```

## šŸ“ Project Structure

```
antigravity-telegram/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ main.py              # Entry point
│   ā”œā”€ā”€ config.py            # Configuration management
│   ā”œā”€ā”€ bot/
│   │   ā”œā”€ā”€ handlers.py      # Telegram command handlers
│   │   ā”œā”€ā”€ keyboards.py     # Inline keyboard builders
│   │   └── message_queue.py # Async message queue
│   ā”œā”€ā”€ mcp_server/
│   │   ā”œā”€ā”€ server.py        # MCP server implementation
│   │   ā”œā”€ā”€ tools.py         # MCP tool definitions
│   │   └── state.py         # Approval state management
│   ā”œā”€ā”€ monitors/
│   │   ā”œā”€ā”€ artifacts.py     # Artifact directory watcher
│   │   └── terminal.py      # Terminal output monitor
│   └── utils/
│       └── formatting.py    # Message formatting
ā”œā”€ā”€ config/
│   └── mcp_config.json      # MCP config template
ā”œā”€ā”€ workflows/
│   └── mobile-command.md    # Antigravity workflow
ā”œā”€ā”€ .env.example
ā”œā”€ā”€ pyproject.toml
└── README.md
```

## šŸ”’ Security

- Only authorized chat IDs can interact with the bot
- Bot tokens are stored in environment variables
- Session files are gitignored

## šŸ“ License

MIT License - see [LICENSE](LICENSE) for details.

## šŸ¤ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

---

Built with ā¤ļø for the Antigravity community

TDQS

A3.9/5.0

Scored across 17 tools

Disambiguation4/5

Tools are largely distinct, with clear semantic purposes for each communication or file operation. Some overlap exists between messaging tools (send_telegram_message vs send_code_update) and between prompt-waiting tools (await_user_response vs wait_for_new_prompt), but descriptions clarify intended use cases.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in lower_snake_case, making the API predictable and easy to navigate.

Tool Count4/5

At 17 tools, the set is slightly large, but each tool addresses a distinct need in the mobile command workflow, covering both communication and project operations. It feels heavy but not bloated.

Completeness4/5

The toolset covers the core lifecycle of receiving prompts, exploring modules, editing files, running commands, and sending updates/approvals. Minor gaps exist (e.g., no dedicated delete file) but can be worked around via terminal commands.

Maintenance

ActivityInactive
ResponsivenessNo issues