/ Diretório / Playground / gemini-mcp-tool
● Comunidade jamubc ⚡ Instantâneo

gemini-mcp-tool

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

Por que usar

Principais recursos

Demo ao vivo

Como fica na prática

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

Instalar

Escolha seu cliente

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

Abra Claude Desktop → Settings → Developer → Edit Config. Reinicie após salvar.

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

Cursor usa o mesmo esquema mcpServers que o Claude Desktop. Config de projeto vence a global.

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

Clique no ícone MCP Servers na barra lateral do Cline, depois "Edit Configuration".

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

Mesmo formato do Claude Desktop. Reinicie o Windsurf para aplicar.

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

O Continue usa um array de objetos de servidor em vez de um map.

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

Adicione em context_servers. Zed recarrega automaticamente ao salvar.

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

Uma linha só. Verifique com claude mcp list. Remova com claude mcp remove.

Casos de uso

Usos do mundo real: 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

Quando usar: Claude can't fit the file, but Gemini can.

Pré-requisitos
  • 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
Fluxo
  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.✓ Copiado
    → 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.✓ Copiado
    → Claude reasons over the summary

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

Armadilhas
  • 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
Combine com: filesystem

How to review an entire small codebase in one shot

👤 Engineers auditing small services ⏱ ~20 min intermediate

Quando usar: You want a holistic review that considers every file at once.

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

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

Armadilhas
  • Gemini loses detail on huge repos — If your src/ exceeds 500k tokens, narrow to subdirectories
Combine com: github

How to execute unsafe code in Gemini's sandbox

👤 Devs testing untrusted code snippets ⏱ ~5 min beginner

Quando usar: You want to try running something without letting it touch your machine.

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

Resultado: Safe execution result.

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

Combinações

Combine com outros MCPs para 10× de alavancagem

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.✓ Copiado
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.✓ Copiado

Ferramentas

O que este MCP expõe

FerramentaEntradasQuando chamarCusto
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

Custo e limites

O que custa rodar

Cota de API
Gemini AI Studio has free tier; paid tier is pay-per-token
Tokens por chamada
Large — this is the whole point. Plan for 100k-500k tokens per call.
Monetário
Gemini 2.5 Flash ~$0.075 per 1M input; Pro is ~20x more
Dica
Default to Flash. Escalate to Pro only when Flash is clearly wrong.

Segurança

Permissões, segredos, alcance

Escopos mínimos: Gemini API key
Armazenamento de credenciais: Gemini CLI stores key in ~/.config/gemini/
Saída de dados: File content goes to Google Gemini; subject to Google's Gemini API data policy
Nunca conceda: Don't pass secrets in @-referenced files — they go straight to Google

Solução de problemas

Erros comuns e correções

gemini-cli not found

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

Verificar: which gemini
401 from Gemini

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

Verificar: 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.

Alternativas

gemini-mcp-tool vs. outros

AlternativaQuando usarTroca
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

Mais

Recursos

📖 Leia o README oficial no GitHub

🐙 Ver issues abertas

🔍 Ver todos os 400+ servidores MCP e Skills