/ Annuaire / Playground / gemini-mcp-tool
● Communauté jamubc ⚡ Instantané

gemini-mcp-tool

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

Pourquoi l'utiliser

Fonctionnalités clés

Démo en direct

Aperçu en pratique

gemini-mcp-tool.replay ▶ prêt
0/0

Installer

Choisissez votre 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
    }
  }
}

Ouvrez Claude Desktop → Settings → Developer → Edit Config. Redémarrez après avoir enregistré.

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

Cursor utilise le même schéma mcpServers que Claude Desktop. La config projet l'emporte sur la globale.

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

Cliquez sur l'icône MCP Servers dans la barre latérale Cline, puis "Edit Configuration".

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

Même format que Claude Desktop. Redémarrez Windsurf pour appliquer.

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

Continue utilise un tableau d'objets serveur plutôt qu'une map.

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

Ajoutez dans context_servers. Zed recharge à chaud à la sauvegarde.

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

Une seule ligne. Vérifiez avec claude mcp list. Supprimez avec claude mcp remove.

Cas d'usage

Usages concrets : 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

Quand l'utiliser : Claude can't fit the file, but Gemini can.

Prérequis
  • 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
Déroulement
  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.✓ Copié
    → 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.✓ Copié
    → Claude reasons over the summary

Résultat : Result that neither model alone could produce in one shot.

Pièges
  • 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
Combiner avec : filesystem

How to review an entire small codebase in one shot

👤 Engineers auditing small services ⏱ ~20 min intermediate

Quand l'utiliser : You want a holistic review that considers every file at once.

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

Résultat : A reviewer's first pass produced in one prompt.

Pièges
  • Gemini loses detail on huge repos — If your src/ exceeds 500k tokens, narrow to subdirectories
Combiner avec : github

How to execute unsafe code in Gemini's sandbox

👤 Devs testing untrusted code snippets ⏱ ~5 min beginner

Quand l'utiliser : You want to try running something without letting it touch your machine.

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

Résultat : Safe execution result.

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

Combinaisons

Associez-le à d'autres MCPs pour un effet X10

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.✓ Copié
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.✓ Copié

Outils

Ce que ce MCP expose

OutilEntréesQuand appelerCoût
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

Coût et limites

Coût d'exécution

Quota d'API
Gemini AI Studio has free tier; paid tier is pay-per-token
Tokens par appel
Large — this is the whole point. Plan for 100k-500k tokens per call.
Monétaire
Gemini 2.5 Flash ~$0.075 per 1M input; Pro is ~20x more
Astuce
Default to Flash. Escalate to Pro only when Flash is clearly wrong.

Sécurité

Permissions, secrets, portée

Portées minimales : Gemini API key
Stockage des identifiants : Gemini CLI stores key in ~/.config/gemini/
Sortie de données : File content goes to Google Gemini; subject to Google's Gemini API data policy
Ne jamais accorder : Don't pass secrets in @-referenced files — they go straight to Google

Dépannage

Erreurs courantes et correctifs

gemini-cli not found

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

Vérifier : which gemini
401 from Gemini

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

Vérifier : 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.

Alternatives

gemini-mcp-tool vs autres

AlternativeQuand l'utiliserCompromis
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

Plus

Ressources

📖 Lire le README officiel sur GitHub

🐙 Voir les issues ouvertes

🔍 Parcourir les 400+ serveurs MCP et Skills