/ Каталог / Песочница / gemini-mcp-tool
● Сообщество jamubc ⚡ Сразу

gemini-mcp-tool

автор 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.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

gemini-mcp-tool.replay ▶ готово
0/0

Установка

Выберите клиент

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

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

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

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

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

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

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

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

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

Continue использует массив объектов серверов, а не map.

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

Добавьте в context_servers. Zed перезагружается автоматически.

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

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: 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

Когда использовать: Claude can't fit the file, but Gemini can.

Предварительные требования
  • 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
Поток
  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.✓ Скопировано
    → 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.✓ Скопировано
    → Claude reasons over the summary

Итог: Result that neither model alone could produce in one shot.

Подводные камни
  • 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
Сочетать с: filesystem

How to review an entire small codebase in one shot

👤 Engineers auditing small services ⏱ ~20 min intermediate

Когда использовать: You want a holistic review that considers every file at once.

Поток
  1. Hand the whole repo
    ask-gemini: @./src/ — review for structural issues, repeated patterns that should be abstracted, and dead code.✓ Скопировано
    → Repo-wide observations
  2. Triage suggestions
    Of those, which 3 are highest impact? Name the files.✓ Скопировано
    → Prioritized list

Итог: A reviewer's first pass produced in one prompt.

Подводные камни
  • Gemini loses detail on huge repos — If your src/ exceeds 500k tokens, narrow to subdirectories
Сочетать с: github

How to execute unsafe code in Gemini's sandbox

👤 Devs testing untrusted code snippets ⏱ ~5 min beginner

Когда использовать: You want to try running something without letting it touch your machine.

Поток
  1. Submit to sandbox
    sandbox-test: run this Python script [paste] — report stdout/stderr and exit code.✓ Скопировано
    → Output without side effects on your machine

Итог: Safe execution result.

Подводные камни
  • Sandbox doesn't have internet by default for most snippets — Check Gemini CLI sandbox docs for connectivity options

Комбинации

Сочетайте с другими MCP — эффект 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.✓ Скопировано
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.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
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

Стоимость и лимиты

Во что обходится

Квота API
Gemini AI Studio has free tier; paid tier is pay-per-token
Токенов на вызов
Large — this is the whole point. Plan for 100k-500k tokens per call.
Деньги
Gemini 2.5 Flash ~$0.075 per 1M input; Pro is ~20x more
Совет
Default to Flash. Escalate to Pro only when Flash is clearly wrong.

Безопасность

Права, секреты, радиус поражения

Минимальные скоупы: Gemini API key
Хранение учётных данных: Gemini CLI stores key in ~/.config/gemini/
Исходящий трафик: File content goes to Google Gemini; subject to Google's Gemini API data policy
Никогда не давайте: Don't pass secrets in @-referenced files — they go straight to Google

Устранение неполадок

Частые ошибки и исправления

gemini-cli not found

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

Проверить: which gemini
401 from Gemini

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

Проверить: 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.

Альтернативы

gemini-mcp-tool в сравнении

АльтернативаКогда использоватьКомпромисс
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

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills