Skip to main content

Gemini Code Context MCP

io.github.qmediat/gemini-code-context-mcp

v1.25.1Updated Nov 21, 2026stdio · npm

Codebase Q&A for Claude Code through Gemini's 1M-token window, with workspace scans and caching.

Install

Nothing to fill in: copy and run.

Run in your terminal

claude mcp add gemini-code-context-mcp -- npx -y @qmediat.io/[email protected]

Configuration

9 settings.

  • GEMINI_API_KEY
    Env var· optional· secret
    Fallback Tier 3 auth. Your Gemini API key. Emits a warning at startup recommending you move it to the credentials profile via the init command.
  • GEMINI_CREDENTIALS_PROFILE
    Env var· optional
    Profile name in ~/.config/qmediat/credentials (chmod 0600). Created by `npx @qmediat.io/gemini-code-context-mcp init`. Recommended; keeps your API key out of ~/.claude.json.
  • GEMINI_USE_VERTEX
    Env var· optional
    Set to `true` to use Vertex AI backend via Application Default Credentials. Requires GOOGLE_CLOUD_PROJECT.
  • GOOGLE_CLOUD_PROJECT
    Env var· optional
    GCP project ID when using Vertex AI backend. Only read when GEMINI_USE_VERTEX=true.
  • GEMINI_DAILY_BUDGET_USD
    Env var· optional
    Hard daily USD cap enforced locally. Server refuses calls after the cap until UTC midnight. Unlimited if unset. Honoured by `ask`, `code`, and per-iteration by `ask_agentic`.
  • GEMINI_CODE_CONTEXT_DEFAULT_MODEL
    Env var· optional
    Model alias (`latest-pro-thinking`, `latest-pro`, `latest-flash`, `latest-lite`, `latest-vision`) or literal model ID, read by ask, ask_agentic and code. Default: `latest-pro-thinking` (the thinking tier). code replaces a configured default that resolves but cannot reason or think with `latest-pro-thinking` and reports it as `configuredModelReplaced`; a default that does not resolve fails every tool.
Show 3 more
  • GEMINI_CODE_CONTEXT_CACHING_MODE
    Env var· optional
    `implicit` (default since v1.14.0: the workspace text is sent inline, Gemini's automatic prefix cache decides any discount) or `explicit` (Files API upload + Context Cache with Google's cached-input price). Per-call `cachingMode` wins.
  • GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS
    Env var· optional
    Context Cache TTL in seconds in explicit caching mode. Default: 3600 (1 hour). Hot workspaces (<10 min since last use) auto-refresh via background watcher.
  • GEMINI_CODE_CONTEXT_LOG_LEVEL
    Env var· optional
    `debug` | `info` | `warn` | `error`. Default: `info`.

Listed in the official MCP Registry since Nov 21, 2026. Mirrored daily; last checked Nov 26, 2026.