Skip to main content
Glama
Ayato964

Antigravity MCP Server

by Ayato964

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 に分析させることができます。


Related MCP server: agy MCP Server

提供するMCPツール一覧

本MCPサーバー (server.py) は、以下のツールをクライアントに公開します。

  1. 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): コマンド実行等の確認プロンプトを自動承認するかどうか。

  2. get_agy_status

    • セッションプロセスの稼働状態(PID、終了コード)と、蓄積されたリアルタイムログを取得します。

    • 引数:

      • conversation_id (str, 任意): 取得対象のセッションID。省略時はデフォルトセッション。

  3. send_input_to_stdin

    • 動作中の agy プロセスの標準入力(stdin)に生の文字列(例: 実行承認の y\n)を直接送信します。

    • 引数:

      • conversation_id (str, 任意): セッションID。省略時はデフォルトセッション。

      • input_text (str, 必須): 送信する文字列(改行 \n を含む)。

  4. stop_agy_session

    • 実行中の agy プロセスを安全に終了、または強制終了します。

    • 引数:

      • conversation_id (str, 任意): セッションID。省略時はデフォルトセッション。

  5. 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 は、自身の持つファイル閲覧ツール等を用いて自動的に画像を開き、内容の理解や分析を行います。

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    A bridge that connects the Model Context Protocol to the Gemini CLI via the Agent Client Protocol (ACP) for high-performance, stateful AI interactions. It enables MCP clients to leverage Gemini's autonomous capabilities, including multi-modal support and built-in tool execution, without cold-start overhead.
    4
    41
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables MCP-compatible coding agents to run the local Antigravity CLI as a coding agent, manage conversation context and common options, and inspect usage, quota, models, version, help, and read-only slash commands.
    18 npm
    MIT