/ Verzeichnis / Playground / gemini-mcp-tool
● Community jamubc ⚡ Sofort

gemini-mcp-tool

von jamubc · jamubc/gemini-mcp-tool

Let Claude call Google Gemini CLI for large-context file analysis — use Gemini's million-token window as a subroutine.

jamubc/gemini-mcp-tool bridges Claude (or any MCP client) to the Gemini CLI. Three tools: ask-gemini (file analysis with @ syntax), sandbox-test (run code in Gemini's sandbox), Ping. Lets you offload large-file and large-codebase analysis to Gemini's 1M-token context.

Warum nutzen

Hauptfunktionen

Live-Demo

In der Praxis

gemini-mcp-tool.replay ▶ bereit
0/0

Installieren

Wählen Sie Ihren Client

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

Öffne Claude Desktop → Settings → Developer → Edit Config. Nach dem Speichern neu starten.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "gemini-mcp-tool": {
      "command": "npx",
      "args": [
        "-y",
        "gemini-mcp-tool"
      ],
      "_inferred": true
    }
  }
}

Cursor nutzt das gleiche mcpServers-Schema wie Claude Desktop. Projektkonfiguration schlägt die globale.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "gemini-mcp-tool": {
      "command": "npx",
      "args": [
        "-y",
        "gemini-mcp-tool"
      ],
      "_inferred": true
    }
  }
}

Klicken Sie auf das MCP-Servers-Symbol in der Cline-Seitenleiste, dann "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "gemini-mcp-tool": {
      "command": "npx",
      "args": [
        "-y",
        "gemini-mcp-tool"
      ],
      "_inferred": true
    }
  }
}

Gleiche Struktur wie Claude Desktop. Windsurf neu starten zum Übernehmen.

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

Continue nutzt ein Array von Serverobjekten statt einer Map.

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

In context_servers hinzufügen. Zed lädt beim Speichern neu.

claude mcp add gemini-mcp-tool -- npx -y gemini-mcp-tool

Einzeiler. Prüfen mit claude mcp list. Entfernen mit claude mcp remove.

Anwendungsfälle

Praxisnahe Nutzung: gemini-mcp-tool

How to analyze a massive file that doesn't fit Claude's context

👤 Developers working with giant logs, codebases, or documents ⏱ ~15 min intermediate

Wann einsetzen: Claude can't fit the file, but Gemini can.

Voraussetzungen
  • Gemini CLI + Google API key — npm i -g @google/gemini-cli; then gemini config set with your key from aistudio.google.com
  • Install MCP — claude mcp add gemini-cli -- npx -y gemini-mcp-tool
Ablauf
  1. Offload analysis
    ask-gemini: @/var/log/app-2026-04.log — find all 5xx errors clustered around deploys in the last 72h, produce a table.✓ Kopiert
    → Gemini analyzes, returns compact summary
  2. Drill in with Claude
    Based on Gemini's summary, focus on the cluster around 2026-04-12 14:30 UTC and propose a root cause.✓ Kopiert
    → Claude reasons over the summary

Ergebnis: Result that neither model alone could produce in one shot.

Fallstricke
  • Sending sensitive logs to Gemini — Strip PII before invoking ask-gemini or use a self-hosted model instead
  • Token cost on Gemini Pro for huge inputs — Use Gemini Flash for cost; Pro only when accuracy matters
Kombinieren mit: filesystem

How to review an entire small codebase in one shot

👤 Engineers auditing small services ⏱ ~20 min intermediate

Wann einsetzen: You want a holistic review that considers every file at once.

Ablauf
  1. Hand the whole repo
    ask-gemini: @./src/ — review for structural issues, repeated patterns that should be abstracted, and dead code.✓ Kopiert
    → Repo-wide observations
  2. Triage suggestions
    Of those, which 3 are highest impact? Name the files.✓ Kopiert
    → Prioritized list

Ergebnis: A reviewer's first pass produced in one prompt.

Fallstricke
  • Gemini loses detail on huge repos — If your src/ exceeds 500k tokens, narrow to subdirectories
Kombinieren mit: github

How to execute unsafe code in Gemini's sandbox

👤 Devs testing untrusted code snippets ⏱ ~5 min beginner

Wann einsetzen: You want to try running something without letting it touch your machine.

Ablauf
  1. Submit to sandbox
    sandbox-test: run this Python script [paste] — report stdout/stderr and exit code.✓ Kopiert
    → Output without side effects on your machine

Ergebnis: Safe execution result.

Fallstricke
  • Sandbox doesn't have internet by default for most snippets — Check Gemini CLI sandbox docs for connectivity options

Kombinationen

Mit anderen MCPs für 10-fache Wirkung

gemini-mcp-tool + filesystem

Pick files locally, pass @-references to Gemini

List all *.log files modified today via filesystem, then ask-gemini @ each to find anomalies.✓ Kopiert
gemini-mcp-tool + github

Review a PR by handing the full diff to Gemini's wide context

Fetch PR #4421 diff via github MCP, then ask-gemini to critique the whole diff as one coherent change.✓ Kopiert

Werkzeuge

Was dieses MCP bereitstellt

WerkzeugEingabenWann aufrufenKosten
ask-gemini prompt: str (may include @path refs), model?: 'flash'|'pro' Large-context analysis Gemini API call — Flash ~$0.075/1M input, Pro higher
sandbox-test code: str, language? Run untrusted code Gemini sandbox billing
Ping Sanity-check connection free

Kosten & Limits

Was der Betrieb kostet

API-Kontingent
Gemini AI Studio has free tier; paid tier is pay-per-token
Tokens pro Aufruf
Large — this is the whole point. Plan for 100k-500k tokens per call.
Kosten in €
Gemini 2.5 Flash ~$0.075 per 1M input; Pro is ~20x more
Tipp
Default to Flash. Escalate to Pro only when Flash is clearly wrong.

Sicherheit

Rechte, Secrets, Reichweite

Minimale Scopes: Gemini API key
Credential-Speicherung: Gemini CLI stores key in ~/.config/gemini/
Datenabfluss: File content goes to Google Gemini; subject to Google's Gemini API data policy
Niemals gewähren: Don't pass secrets in @-referenced files — they go straight to Google

Fehlerbehebung

Häufige Fehler und Lösungen

gemini-cli not found

Install globally: npm i -g @google/gemini-cli; ensure npm global bin is on PATH.

Prüfen: which gemini
401 from Gemini

Run gemini config to set your API key from aistudio.google.com.

Prüfen: gemini 'hello'
Token limit exceeded

Even Gemini has caps; trim @-references or use search to narrow files first.

Sandbox timeout

Long-running code needs higher timeout; or run locally in a container instead.

Alternativen

gemini-mcp-tool vs. andere

AlternativeWann stattdessenKompromiss
deep-research MCPYou want autonomous research, not raw Gemini accessDifferent shape; includes web search
openrouter MCPYou want multi-model access via one keyNo @-file syntax; less convenient for big-context

Mehr

Ressourcen

📖 Offizielle README auf GitHub lesen

🐙 Offene Issues ansehen

🔍 Alle 400+ MCP-Server und Skills durchsuchen