gemini-buddy-mcp
Local media preparation and measurement: clips small mp4 segments from a video, extracts frame sequences (with crop, grid-scale overlays, and contact sheets plus an index of timestamps), and produces audio analysis (mono 16 kHz wav, waveform, spectrogram, LUFS loudness, and detected sound/silence spans in source-file seconds).
Provides code review over a git repository's diff (working tree, staged, a base branch, or a specific commit) with a stated author intent; the diff is read-only, and results from several models can be merged so identical findings at the same location are aggregated with a count of agreeing models.
Uses Google's Gemini models: subscription-authenticated Antigravity CLI (agy) subprocesses for second opinions, media analysis (transcription, speaker separation, screen motion, approximate coordinates) and code review, plus the google-genai SDK with an API key for image generation and text-to-speech audio generation saved to file.
Local numeric measurement of media: computes loudness, the level difference between a voice track and the final mix, and identifies time spans where the voice is buried under BGM.
Local object tracking in video: template matching follows a single object across frames within a time range and returns per-frame center coordinates and match confidence, usable for precise positioning where model estimates are too coarse.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
gemini-buddy-mcp

この絵も gemini-buddy-mcp で作りました(gemini_consult で Gemini と案を相談し、gemini_generate_image の backend="agy" で生成)。
Claude Code などの MCP クライアントから Gemini を「相棒」として呼ぶための、stdio 型の MCP サーバーです。agy-media(スキル版)の中身をすべて MCP のツールに移しました。
相談・メディア解析・コードレビューは、サブスクでログイン済みの Antigravity CLI(
agy)をサブプロセスで動かします。子プロセスの環境変数からGEMINI_API_KEY・GOOGLE_API_KEYを消すので、API キーの課金には流れません。画像・音声の生成は、
GEMINI_API_KEYを使ってgoogle-genaiSDK で行います(API のクレジット枠)。画像は agy の組み込みの生成(サブスク)でも作れます。機械的な下ごしらえと計測はローカルで:ffmpeg での切り出し・コマ画像化・座標の目盛り、無音区間・ラウドネス・スペクトログラム、声と BGM の音量差、OpenCV での追跡、座標の描き込み確認。
どのツールも
session_idを受け取れます。会話・解析したメディアの要約・作ったファイルは~/.gemini-buddy-mcp/sessions/<session_id>.jsonに残り、同じsession_idを渡すと続きから頼めます。ツールの返り値はテキストとファイルのパスだけで、画像や音声のバイナリは返しません。
English: A stdio MCP server that lets Claude consult Gemini through the subscription-authenticated
agyCLI (API keys are stripped from its environment) for second opinions, media analysis and code review; generate images and speech with thegoogle-genaiSDK; and prepare / measure media locally (ffmpeg, numpy, OpenCV). Every tool shares a persistentsession_id. Tools return text and file paths, never binary data.
ツール
Gemini に頼む
ツール | 使う枠 | すること |
| agy | コードや設計のセカンドオピニオン。 |
| agy | 動画・音声・画像を見て・聞いての文字起こし、話者分け、画面の動き、BGM が場面に合うか、おおよその座標。答えの要約をセッションに残す |
| agy | git の差分を読むだけでレビュー。複数のモデルを並べると、同じ場所の指摘をまとめる |
| API / agy | 画像を作って保存し、パスを返す。 |
| API | TTS で読み上げて保存し、パスと長さ(秒)を返す。 |
| — | 保存したセッションを新しい順に( |
ローカルの下ごしらえと計測(モデルは使わない)
ツール | すること |
| agy に渡す小さな mp4(既定 720p・30fps)を切り出す |
| 範囲をコマ画像にし、 |
|
|
| 声だけのトラックを完成品に位置合わせして差し引き、声と BGM の差と、声が埋もれる区間( |
| OpenCV のテンプレートマッチングで 1 つの物を追う(全フレームの中心座標と一致度) |
| 座標をコマに描き込んで並べた確認用の画像を作る。Gemini の答え( |
session_idを省くと新しいセッションを作ります(ローカルのツールは作りません)。タイトルは最初のプロンプトを 60 文字に縮めたものです。ローカルのツールの出力先を省くと、
~/.gemini-buddy-mcp/work/<session_id>/(セッションなしなら_misc/)の下に新しいフォルダを作ります。サーバーは MCP の
instructionsで、使い方の注意(下の「確かめ方」)をクライアントに渡します。
Related MCP server: mcp-gemini-assistant
確かめ方(agy の答えをそのまま信じない)
座標:
media_framesの目盛り付きのコマで読ませ、media_overlayで描き込んで自分の目で見る。読ませるモデルはgemini-4-neon-high。時刻:Gemini が返す時刻は 0.5〜1 秒ずれる。
media_audioのsound_spansを使う(無音区間は発話の区切りとほぼ一致し、字幕との差は 0.05 秒以内だった)。BGM の音量:
media_mix_balanceの数値で判断する。トーク動画の目安は BGM が声より 12〜20 dB 下。Gemini は「BGM が大きめ」という全体の傾向は当てたが、「声が埋もれている」と挙げた時刻は外れていた。曲調が場面に合うかの判断は Gemini に任せてよいが、1 つの意見として扱う。発音の違和感:候補として扱い、人が聞いて確かめる(モデルごとに挙げる語がばらばら)。
コードレビュー:指摘は 1 件ずつ実際のコードでたどってから報告する。
agreed(同じ場所を挙げたモデルの数)が多くても確かめずに本物扱いしない。逆に 1 モデルだけの指摘にも本物はある。intentには作者の意図だけを書き、Claude の意見は混ぜない。
必要なもの
Python 3.10+
agy(インストールしてログイン済み。agy modelsでモデルが出ること)生成ツールを API で使うなら
GEMINI_API_KEYローカルのツールには Pillow・numpy・OpenCV・ffmpeg(
[media]で入る。ffmpeg は PATH に無ければ imageio-ffmpeg のものを使う)gemini_reviewには git
入れ方
git clone https://github.com/holmesfems/gemini-buddy-mcpcd gemini-buddy-mcppython -m venv .venv.venv\Scripts\python -m pip install -e ".[media]"Claude Code への登録
venv の中の実行ファイルを指定します(パスは clone した場所に合わせてください)。--scope user にすると、どのプロジェクトからも使えます。
claude mcp add gemini-buddy --scope user -- "C:\path\to\gemini-buddy-mcp\.venv\Scripts\gemini-buddy-mcp.exe"macOS / Linux:
claude mcp add gemini-buddy --scope user -- /path/to/gemini-buddy-mcp/.venv/bin/gemini-buddy-mcpuv を使うなら、clone せずに:
claude mcp add gemini-buddy --scope user -- uvx --from "gemini-buddy-mcp[media] @ git+https://github.com/holmesfems/gemini-buddy-mcp" gemini-buddy-mcpAPI キー(API での画像生成・TTS に使う。ほかのツールは agy のログインとローカルだけで動く):
GEMINI_API_KEYは、ユーザーの環境変数に入れておけばサーバーがそのまま引き継ぎます(Windows なら「環境変数を編集」で、ユーザー環境変数に追加)。キーを入れたあとは Claude Code(デスクトップアプリならアプリごと)を起動し直してください。起動中のプロセスには新しい環境変数が届きません。claude mcp addに-e GEMINI_API_KEY=$env:GEMINI_API_KEYを付ける書き方は勧めません。キーの値が~/.claude.jsonに平文で残るうえ、そのシェルにキーがまだ無いと空の値で登録されてしまいます(その場合、生成ツールは「set but empty」というエラーを返します)。agy の答えは 10 秒〜数分かかります(コードレビューは 1 モデルで 2〜4 分)。Claude Code 側が先に打ち切るときは、起動前に
MCP_TOOL_TIMEOUT(ミリ秒)を長めにしてください。
設定(環境変数)
変数 | 既定 | 意味 |
| — | API での生成に使うキー(agy には渡さない) |
|
|
|
|
|
|
|
|
|
|
| API の画像生成モデル |
|
| API の読み上げモデル |
|
| agy を待つ秒数(レビューは 1 モデル 900 秒) |
| PATH の | agy の実行ファイル |
|
| セッションと作業フォルダを置く場所 |
|
| agy が画像を保存するフォルダ( |
API の画像・TTS のモデル ID が違っていて失敗したときは、エラーにその API キーで使える近い名前のモデルの一覧が付きます。それを環境変数に入れてください。
Gemini 4 のモデルの比べ(agy-media での実測、agy 1.5.12)
同じ素材で Argon・Neon・Hydrogen(いずれも High)を比べ、既定のモデルを決めた。
試したこと | Argon | Neon | Hydrogen | 使うモデル |
音声 40 秒の文字起こし・話者分け | 本文・話者とも正しい/70 秒 | 同じ/103 秒 | 同じ/49 秒 | Hydrogen |
発音の違和感の指摘 | 12 件(多すぎる) | 3 件 | 3 件 | どれも候補扱い |
動画 40 秒(ロゴ・タイトル・セリフ) | 正しい/86 秒 | 正しい/52 秒 | 正しい/45 秒 | Hydrogen |
目盛り付きコマの座標(6 か所) | 字幕を 140 px 外す | 2 px 以内 | 縦に 8 px ずれ | Neon |
コードレビュー(4 つ埋めたバグ) | 4/4/161 秒 | 4/4 +本物の競合 1 件/217 秒 | 4/4/90 秒 | Neon |
Flash 系のモデルは、音声のあと出力が途切れて失敗した。
ゲーム録画の敵の位置は、目盛りなしでは約 100 px ずれた。目盛りありでも、動いている間は 50〜90 px ずれる。おおよその位置や動きの流れには使えるが、精密な位置合わせには
media_trackを使う(エフェクトが激しく重なる対象は見失いやすい)。コードレビューで差が出たのは、埋めていない本物の不具合(保存の競合)で、見つけたのは Neon だけだった。
安全のために
agy は
--mode plan(読むだけ)で動かし、--dangerously-skip-permissionsは付けません。agy が読めるのは、渡したファイルのあるフォルダ(--add-dir)だけです。backend="agy"の画像生成だけは、agy が自分のフォルダに画像を書けるようaccept-editsで動かし、ほかのファイルに触れないよう指示します。頭なしの agy はコマンドを実行できないので、切り出しなどは
media_*で済ませてから渡してください。denied_actionsが返ったら、agy が何かを実行しようとした印です。gemini_reviewのコードは Google に送られます。.env・鍵・credentials のファイルは差分から外し(大文字小文字は問わない)、差分のどの行にでも API キーや秘密鍵らしい文字列があれば、何も送らずにSTOPPEDを返します。ただし agy はリポジトリ全体を読めるので、秘密を置いたファイルがあるなら agy の settings.json の deny(read_file(regex:.*\.env.*)など)に足してください。session_idは UUID しか受け付けません(セッションのフォルダの外を指せないように)。
テスト
agy も API キーも使わないテスト(ローカルのツールは ffmpeg で作った動画・音声で確かめる):
.venv\Scripts\python -m unittest discover -s testsTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Generate images and video from Claude with one API key.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables Claude Desktop to interact with Google's Gemini API, allowing users to query Gemini models directly or facilitate conversations between Claude and Gemini with conversation history management.-
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to consult Gemini for complex coding problems with session management, file attachments, and conversation persistence.106MIT
- AlicenseAqualityDmaintenanceIntegrates the local gemini CLI tool with Claude Code, allowing Claude to execute Gemini AI queries via the MCP protocol.11MIT
- AlicenseCqualityFmaintenanceBrings all SuperClaude features to Gemini CLI, enabling advanced coding assistance, persona switching, and token optimization.2066 npm3MIT