/ Directory / Playground / Gemini CLI
● Official google-gemini 🔑 Needs your key

Gemini CLI

by 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.

Why use it

Key features

Live Demo

What it looks like in practice

ready

Install

Pick your client

~/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"
      ]
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

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

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

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

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

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

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

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

Continue uses an array of server objects rather than a map.

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

Add to context_servers. Zed hot-reloads on save.

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

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use Gemini CLI

Get a Gemini second opinion on Claude's plan

👤 Developers ⏱ ~15 min intermediate

When to use: You're about to ship something risky; want a fresh take from a different model.

Flow
  1. Bridge
    Add Gemini CLI as an MCP server.✓ Copied
    → Tool visible
  2. Ask
    Have Claude pass the plan to Gemini for critique.✓ Copied
    → Critique returns
  3. Reconcile
    Claude updates the plan with Gemini's feedback.✓ Copied
    → Better plan

Outcome: Two-model review without manual copy-paste.

Combinations

Pair with other MCPs for X10 leverage

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✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
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

Cost & Limits

What this costs to run

API quota
Google AI free tier; paid for higher rate
Tokens per call
Per Gemini pricing
Monetary
Free tier; paid plans
Tip
Use Gemini for large-context summaries where its 2M-token window pays off

Security

Permissions, secrets, blast radius

Minimum scopes: gemini:api
Credential storage: API key in env
Data egress: generativelanguage.googleapis.com
Never grant: Pass real customer data without checking Gemini data terms

Troubleshooting

Common errors and fixes

429 quota exceeded

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

Alternatives

Gemini CLI vs others

AlternativeWhen to use it insteadTradeoff
claude-code (self)Single-model is fineNo second opinion

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills

Continue exploring

Related tools and workflows

Choose another guide for your workflow, or explore a collection.

Shared context · gemini

Gemini API Skills

Google’s Gemini skills guide API, SDK, model, function-calling, and realtime interaction workflows.

Skill

Browse all topic collections → · See 29 new official additions →