NestDaddy

Gemini Code Context Mcp

io.github.qmediat/gemini-code-context-mcp · v1.20.0

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

Connect Runs on your machine

Terminal
claude mcp add gemini-code-context-mcp -e GEMINI_CREDENTIALS_PROFILE=<GEMINI_CREDENTIALS_PROFILE> -e GEMINI_API_KEY=<GEMINI_API_KEY> -e GEMINI_USE_VERTEX=<GEMINI_USE_VERTEX> -e GOOGLE_CLOUD_PROJECT=<GOOGLE_CLOUD_PROJECT> -e GEMINI_DAILY_BUDGET_USD=<GEMINI_DAILY_BUDGET_USD> -e GEMINI_CODE_CONTEXT_DEFAULT_MODEL=<GEMINI_CODE_CONTEXT_DEFAULT_MODEL> -e GEMINI_CODE_CONTEXT_CACHING_MODE=<GEMINI_CODE_CONTEXT_CACHING_MODE> -e GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS=<GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS> -e GEMINI_CODE_CONTEXT_LOG_LEVEL=<GEMINI_CODE_CONTEXT_LOG_LEVEL> -- npx -y @qmediat.io/[email protected]
claude_desktop_config.json
{
  "mcpServers": {
    "gemini-code-context-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@qmediat.io/[email protected]"
      ],
      "env": {
        "GEMINI_CREDENTIALS_PROFILE": "<GEMINI_CREDENTIALS_PROFILE>",
        "GEMINI_API_KEY": "<GEMINI_API_KEY>",
        "GEMINI_USE_VERTEX": "<GEMINI_USE_VERTEX>",
        "GOOGLE_CLOUD_PROJECT": "<GOOGLE_CLOUD_PROJECT>",
        "GEMINI_DAILY_BUDGET_USD": "<GEMINI_DAILY_BUDGET_USD>",
        "GEMINI_CODE_CONTEXT_DEFAULT_MODEL": "<GEMINI_CODE_CONTEXT_DEFAULT_MODEL>",
        "GEMINI_CODE_CONTEXT_CACHING_MODE": "<GEMINI_CODE_CONTEXT_CACHING_MODE>",
        "GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS": "<GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS>",
        "GEMINI_CODE_CONTEXT_LOG_LEVEL": "<GEMINI_CODE_CONTEXT_LOG_LEVEL>"
      }
    }
  }
}
~/.cursor/mcp.json
{
  "mcpServers": {
    "gemini-code-context-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@qmediat.io/[email protected]"
      ],
      "env": {
        "GEMINI_CREDENTIALS_PROFILE": "<GEMINI_CREDENTIALS_PROFILE>",
        "GEMINI_API_KEY": "<GEMINI_API_KEY>",
        "GEMINI_USE_VERTEX": "<GEMINI_USE_VERTEX>",
        "GOOGLE_CLOUD_PROJECT": "<GOOGLE_CLOUD_PROJECT>",
        "GEMINI_DAILY_BUDGET_USD": "<GEMINI_DAILY_BUDGET_USD>",
        "GEMINI_CODE_CONTEXT_DEFAULT_MODEL": "<GEMINI_CODE_CONTEXT_DEFAULT_MODEL>",
        "GEMINI_CODE_CONTEXT_CACHING_MODE": "<GEMINI_CODE_CONTEXT_CACHING_MODE>",
        "GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS": "<GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS>",
        "GEMINI_CODE_CONTEXT_LOG_LEVEL": "<GEMINI_CODE_CONTEXT_LOG_LEVEL>"
      }
    }
  }
}
.vscode/mcp.json
{
  "servers": {
    "gemini-code-context-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@qmediat.io/[email protected]"
      ],
      "env": {
        "GEMINI_CREDENTIALS_PROFILE": "<GEMINI_CREDENTIALS_PROFILE>",
        "GEMINI_API_KEY": "<GEMINI_API_KEY>",
        "GEMINI_USE_VERTEX": "<GEMINI_USE_VERTEX>",
        "GOOGLE_CLOUD_PROJECT": "<GOOGLE_CLOUD_PROJECT>",
        "GEMINI_DAILY_BUDGET_USD": "<GEMINI_DAILY_BUDGET_USD>",
        "GEMINI_CODE_CONTEXT_DEFAULT_MODEL": "<GEMINI_CODE_CONTEXT_DEFAULT_MODEL>",
        "GEMINI_CODE_CONTEXT_CACHING_MODE": "<GEMINI_CODE_CONTEXT_CACHING_MODE>",
        "GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS": "<GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS>",
        "GEMINI_CODE_CONTEXT_LOG_LEVEL": "<GEMINI_CODE_CONTEXT_LOG_LEVEL>"
      }
    }
  }
}

Replace the values in angle brackets with your own. Keys stay on your machine; we never see them.

Tools

This server runs locally, so its tools are listed by your MCP client once it starts.

Environment variables

NameDescription
GEMINI_CREDENTIALS_PROFILE
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_API_KEY
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_USE_VERTEX
Optional
Set to `true` to use Vertex AI backend via Application Default Credentials. Requires GOOGLE_CLOUD_PROJECT.
GOOGLE_CLOUD_PROJECT
Optional
GCP project ID when using Vertex AI backend. Only read when GEMINI_USE_VERTEX=true.
GEMINI_DAILY_BUDGET_USD
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
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-…
GEMINI_CODE_CONTEXT_CACHING_MODE
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
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
Optional
`debug` | `info` | `warn` | `error`. Default: `info`.

Details

Package@qmediat.io/[email protected] (NPM, stdio)
First published6 Oct 2026
Last updated6 Oct 2026
Registry nameio.github.qmediat/gemini-code-context-mcp

More developer tools servers See all

Listing data from the official MCP registry. Status and tools from NestDaddy's daily check. Browse all MCP servers.