Antigravity MCP Server
Enables external agents like Gemini Spark to control Google Antigravity CLI (agy) via Model Context Protocol, supporting multimodal inputs and automatic session management.
README
Antigravity MCP Server
このプロジェクトは、GoogleのAIエージェント実行基盤である Google Antigravity CLI (agy) を、Model Context Protocol (MCP) を介して Gemini Spark などの外部エージェントから操作できるようにするためのMCPサーバー実装です。
概要
特徴
- サブスクリプションの利用: ローカル環境でOAuthログインされた
agyの認証情報をバックグラウンドプロセスとして透過的に利用するため、Google AI Ultra / Gemini Advanced サブスクリプションの高クォータで動作します。 - デフォルト自動起動: MCPサーバーの起動時、ライフサイクルハンドラ(
lifespan)によってデフォルトのagyプロセスがバックグラウンドで自動起動され、即座に対話可能な状態になります。 - マルチモーダル対応: メディアデータ(画像、音声、PDF、動画など)をBase64で受け取り、作業ディレクトリ内の
mcp_dataフォルダに自動デコード・保存し、その絶対パス情報をプロンプトに付与してagyに分析させることができます。
提供するMCPツール一覧
本MCPサーバー ([server.py](file:///C:/Users/admin/MyProject/Antigravity_MCP/server.py)) は、以下のツールをクライアントに公開します。
-
send_message(マルチモーダル対応)- 指定したセッション(またはデフォルトセッション)にメッセージを送信します。
- すでに
agyプロセスがバックグラウンドで実行中の場合は標準入力(stdin)に追記し、停止している場合は新しくプロセスを起動します。 - 引数:
text(str, 任意): 送信するテキストプロンプト。media(list of dict, 任意): メディアファイルのリスト。各要素は{"data": "<Base64文字列>", "mime_type": "mime/type", "filename": "filename.ext"}。conversation_id(str, 任意): 対象セッションのUUID。指定しない場合はサーバー起動時に自動生成されたデフォルトセッションIDが使用されます。dangerously_skip_permissions(bool, 任意, デフォルト:False): コマンド実行等の確認プロンプトを自動承認するかどうか。
-
get_agy_status- セッションプロセスの稼働状態(PID、終了コード)と、蓄積されたリアルタイムログを取得します。
- 引数:
conversation_id(str, 任意): 取得対象のセッションID。省略時はデフォルトセッション。
-
send_input_to_stdin- 動作中の
agyプロセスの標準入力(stdin)に生の文字列(例: 実行承認のy\n)を直接送信します。 - 引数:
conversation_id(str, 任意): セッションID。省略時はデフォルトセッション。input_text(str, 必須): 送信する文字列(改行\nを含む)。
- 動作中の
-
stop_agy_session- 実行中の
agyプロセスを安全に終了、または強制終了します。 - 引数:
conversation_id(str, 任意): セッションID。省略時はデフォルトセッション。
- 実行中の
-
list_active_sessions- 現在起動しているすべての
agyセッション(PIDやステータス)およびデフォルトセッションのUUID一覧を返します。
- 現在起動しているすべての
セットアップと実行方法
1. 依存ライブラリのインストール
# 仮想環境の有効化
.venv\Scripts\activate
# インストール
pip install -r requirements.txt
2. サーバーの起動
mcp dev server.py
起動すると、ターミナルに以下のようなインスペクターURLが表示され、デフォルトの agy プロセスがPIDと共に自動起動します:
🚀 MCP Inspector is up and running at: http://localhost:...
マルチモーダルの連携例
クライアントが send_message ツールを通じてメディアを送信すると、サーバーは C:\Users\admin\MyProject\Antigravity_MCP\mcp_data に保存し、以下のような参照形式を自動的にプロンプトに付与して agy に引き渡します:
(テキストメッセージ)
[Attached Media Files]
- Path: C:/Users/admin/MyProject/Antigravity_MCP/mcp_data/screenshot.png (MIME: image/png)
これを受けた agy は、自身の持つファイル閲覧ツール等を用いて自動的に画像を開き、内容の理解や分析を行います。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.