Skip to content

Gemini

@ask-llm/gemini-mcpenterprise default gemini-3.1-pro-preview → fallback gemini-3.6-flash

Bridge Claude with Google's Gemini via the official Gemini CLI. Leverages Gemini's massive 1M+ token context window for large file and codebase analysis while Claude handles interaction and code editing.

Discontinued on consumer tiers: migrate to Antigravity

From 2026-06-18, Google restricts Gemini CLI access to Gemini Code Assist Standard/Enterprise seats; free, Google AI Pro, and Ultra accounts lose access. @ask-llm/gemini-mcp still installs and launches; the failure is a runtime auth/quota error from Google's backend, not a missing binary.

On a subscription tier? Migrate to Antigravity (agy), Google's successor CLI, covered by the same AI Pro/Ultra subscription with no per-token billing. Install @ask-llm/antigravity-mcp, or switch to ask-codex / ask-ollama. The 2026-06-18 tier change section below covers what happens at runtime.

2026-06-18 tier change

From 2026-06-18, Google serves Gemini CLI requests only for Gemini Code Assist Standard/Enterprise accounts; free, Google AI Pro, and Ultra accounts lose access. The surviving tiers keep working with the same gemini binary and backend.

What this means for @ask-llm/gemini-mcp:

  • The npm package still installs and launches; the binary is unchanged. The failure for non-enterprise accounts is a runtime auth/quota error, not a missing binary, so reinstalling will not help.
  • On or after the cutoff, an auth/quota-class failure now surfaces an actionable notice (cutoff date + options) instead of a raw error. The note is advisory ("likely caused by the tier change"); a genuine auth, billing, or quota error can also trigger it.
  • Google's successor is the Antigravity CLI (agy), a separate, closed-source binary that @ask-llm/gemini-mcp does not wrap. Use the dedicated @ask-llm/antigravity-mcp package (covered by the same Google AI Pro/Ultra subscription, no per-token billing), run agy directly, or switch to ask-codex / ask-ollama.
  • Testing the guidance: set ASK_GEMINI_TIER_CUTOFF to a past UTC instant (e.g. 2020-01-01T00:00:00Z) to force the post-cutoff gate on; an auth/quota failure will then prepend the notice. The default cutoff is 2026-06-18T00:00:00Z.

Google's announcement.

Best for: whole-codebase reads using the 1M+ token context window, if you have an eligible Gemini Code Assist Standard/Enterprise seat. Not for: most users from 2026-06-18 (see the notice above). For large-context reads without an enterprise seat, use Antigravity.

Installation

1. Provider CLI

npm install -g @google/gemini-cli && gemini login

2. Register the MCP server (Claude Code shown; see Quick Start for other clients)

claude mcp add --scope user gemini -- npx -y @ask-llm/gemini-mcp

Or install globally: npm install -g @ask-llm/gemini-mcp

Prerequisites

  1. Node.js v20.0.0 or higher
  2. Gemini CLI installed and authenticated:
bash
npm install -g @google/gemini-cli
gemini login

Tools

ToolPurpose
ask-geminiSend prompts to Gemini CLI with @ file syntax. Optional sessionId for multi-turn; live progressive output via --output-format stream-json
ask-gemini-editStructured code edits via Gemini changeMode. Returns OLD/NEW edit blocks. Supports includeDirs for monorepo context
fetch-chunkRetrieve subsequent chunks from cached large responses
get-usage-statsPer-session token totals + breakdowns by provider/model. In-memory
pingFast connection test to verify MCP setup

ask-gemini returns both human-readable text and a structured AskResponse (provider, response, model, sessionId, usage) via MCP outputSchema; programmatic clients can extract the sessionId and usage fields directly without parsing the response footer.

Models

gemini-3.1-pro-previewquota / rate limitgemini-3.6-flash
When the default model hits quota, the executor retries once on the fallback and reports the actual model used in the response.
  • Default: gemini-3.1-pro-preview (latest, highest capability)
  • Quota fallback: gemini-3.6-flash, automatic on RESOURCE_EXHAUSTED
  • Overrides: ASK_GEMINI_MODEL, ASK_GEMINI_FALLBACK_MODEL, or the per-call model parameter

Key Features

  • 1M+ token context for analyzing entire codebases
  • Multi-turn sessions via sessionId: native --resume <id> (zero replay cost)
  • Include directories for monorepo context (includeDirs parameter on ask-gemini-edit)
  • Live progressive output: assistant message deltas stream to MCP progress notifications, no frozen waits on long calls
  • Structured AskResponse via outputSchema for programmatic clients
  • Automatic quota fallback from Pro to Flash on RESOURCE_EXHAUSTED

npm

Released under the MIT License.