/ ディレクトリ / プレイグラウンド / Gemini CLI
● 公式 google-gemini 🔑 自分のキーが必要

Gemini CLI

作者 google-gemini · google-gemini/gemini-cli

Gemini's official terminal agent — it does shell tasks autonomously and exposes that capability via MCP, so Claude can call Gemini for cross-model second opinions.

Gemini CLI is Google's terminal-native agent (Codex/Claude Code analog). Its MCP surface lets Claude delegate work to Gemini — useful for second opinions, large-context tasks, or model-comparison evaluations.

なぜ使うのか

主な機能

ライブデモ

実際の動作

準備完了

インストール

クライアントを選択

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "gemini-cli-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@google/gemini-cli",
        "mcp"
      ]
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config を開く。保存後、アプリを再起動。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "gemini-cli-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@google/gemini-cli",
        "mcp"
      ]
    }
  }
}

Cursor は Claude Desktop と同じ mcpServers スキーマを使用。プロジェクト設定はグローバルより優先。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "gemini-cli-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@google/gemini-cli",
        "mcp"
      ]
    }
  }
}

Cline サイドバーの MCP Servers アイコンをクリックし、"Edit Configuration" を選択。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "gemini-cli-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@google/gemini-cli",
        "mcp"
      ]
    }
  }
}

Claude Desktop と同じ形式。Windsurf を再起動して反映。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "gemini-cli-mcp",
      "command": "npx",
      "args": [
        "-y",
        "@google/gemini-cli",
        "mcp"
      ]
    }
  ]
}

Continue はマップではなくサーバーオブジェクトの配列を使用。

~/.config/zed/settings.json
{
  "context_servers": {
    "gemini-cli-mcp": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@google/gemini-cli",
          "mcp"
        ]
      }
    }
  }
}

context_servers に追加。保存時に Zed がホットリロード。

claude mcp add gemini-cli-mcp -- npx -y @google/gemini-cli mcp

ワンライナー。claude mcp list で確認、claude mcp remove で削除。

ユースケース

実用的な使い方: Gemini CLI

Get a Gemini second opinion on Claude's plan

👤 Developers ⏱ ~15 min intermediate

使うタイミング: You're about to ship something risky; want a fresh take from a different model.

フロー
  1. Bridge
    Add Gemini CLI as an MCP server.✓ コピーしました
    → Tool visible
  2. Ask
    Have Claude pass the plan to Gemini for critique.✓ コピーしました
    → Critique returns
  3. Reconcile
    Claude updates the plan with Gemini's feedback.✓ コピーしました
    → Better plan

結果: Two-model review without manual copy-paste.

組み合わせ

他のMCPと組み合わせて10倍の力を

gemini-cli-mcp + github

Have Gemini draft a refactor plan, then Claude opens the PR via GitHub MCP

Combine gemini-cli-mcp with github: Have Gemini draft a refactor plan, then Claude opens the PR via GitHub MCP✓ コピーしました

ツール

このMCPが提供する機能

ツール入力呼び出すタイミングコスト
gemini.ask (see docs) Send a prompt to Gemini, get a response 1 call
gemini.run_task (see docs) Run an autonomous shell task 1 call

コストと制限

運用コスト

APIクォータ
Google AI free tier; paid for higher rate
呼び出しあたりのトークン
Per Gemini pricing
金額
Free tier; paid plans
ヒント
Use Gemini for large-context summaries where its 2M-token window pays off

セキュリティ

権限、シークレット、影響範囲

最小スコープ: gemini:api
認証情報の保管: API key in env
データ送信先: generativelanguage.googleapis.com
絶対に付与しない: Pass real customer data without checking Gemini data terms

トラブルシューティング

よくあるエラーと対処法

429 quota exceeded

Wait or upgrade plan; check key has the right Vertex/AI Studio scope

代替案

Gemini CLI 他との比較

代替案代わりに使う場面トレードオフ
claude-code (self)Single-model is fineNo second opinion

その他

リソース

📖 GitHub の公式 README を読む

🐙 オープンな issue を見る

🔍 400以上のMCPサーバーとSkillsを見る