AgentHubAgentHub

gemini-code-context-mcp

MCP ServerMCP Registry官方收录

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

Gemini 2M context cache for Claude Code — persistent; repeat queries ~8x faster, ~4x cheaper.

概览

gemini-code-context-mcp 是一个MCP Server,收录自 官方 MCP Registry。支持 stdio 传输。本页提供 Cursor、Claude Code 等客户端的安装配置片段。

安装

选择你的平台查看安装方式

{
  "mcpServers": {
    "gemini-code-context-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@qmediat.io/gemini-code-context-mcp"
      ]
    }
  }
}

环境变量

GEMINI_CREDENTIALS_PROFILE可选

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可选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可选

Set to `true` to use Vertex AI backend via Application Default Credentials. Requires GOOGLE_CLOUD_PROJECT.

GOOGLE_CLOUD_PROJECT可选

GCP project ID when using Vertex AI backend. Only read when GEMINI_USE_VERTEX=true.

GEMINI_DAILY_BUDGET_USD可选

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可选

Model alias (`latest-pro`, `latest-pro-thinking`, `latest-flash`, `latest-lite`, `latest-vision`) or literal model ID. Default: `latest-pro`.

GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS可选

Context Cache TTL in seconds. Default: 3600 (1 hour). Hot workspaces (<10 min since last use) auto-refresh via background watcher.

GEMINI_CODE_CONTEXT_LOG_LEVEL可选

`debug` | `info` | `warn` | `error`. Default: `info`.

相关资源

统一 Manifest

{
  "id": "io.github.qmediat/gemini-code-context-mcp",
  "type": "mcp-server",
  "version": "1.16.3",
  "displayName": "gemini-code-context-mcp",
  "description": "Gemini 2M context cache for Claude Code — persistent; repeat queries ~8x faster, ~4x cheaper.",
  "repository": {
    "url": "https://github.com/qmediat/gemini-code-context-mcp",
    "source": "github"
  },
  "distribution": {
    "packages": [
      {
        "registryType": "npm",
        "identifier": "@qmediat.io/gemini-code-context-mcp",
        "version": "1.16.3",
        "transport": "stdio",
        "environmentVariables": [
          {
            "name": "GEMINI_CREDENTIALS_PROFILE",
            "description": "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."
          },
          {
            "name": "GEMINI_API_KEY",
            "description": "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.",
            "isSecret": true
          },
          {
            "name": "GEMINI_USE_VERTEX",
            "description": "Set to `true` to use Vertex AI backend via Application Default Credentials. Requires GOOGLE_CLOUD_PROJECT."
          },
          {
            "name": "GOOGLE_CLOUD_PROJECT",
            "description": "GCP project ID when using Vertex AI backend. Only read when GEMINI_USE_VERTEX=true."
          },
          {
            "name": "GEMINI_DAILY_BUDGET_USD",
            "description": "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`."
          },
          {
            "name": "GEMINI_CODE_CONTEXT_DEFAULT_MODEL",
            "description": "Model alias (`latest-pro`, `latest-pro-thinking`, `latest-flash`, `latest-lite`, `latest-vision`) or literal model ID. Default: `latest-pro`."
          },
          {
            "name": "GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS",
            "description": "Context Cache TTL in seconds. Default: 3600 (1 hour). Hot workspaces (<10 min since last use) auto-refresh via background watcher."
          },
          {
            "name": "GEMINI_CODE_CONTEXT_LOG_LEVEL",
            "description": "`debug` | `info` | `warn` | `error`. Default: `info`."
          }
        ]
      }
    ],
    "remotes": []
  },
  "dependencies": [],
  "installTargets": [
    "claude-code",
    "claude-desktop",
    "cursor",
    "vscode"
  ],
  "keywords": [],
  "provenance": {
    "origin": "official-mcp-registry",
    "originalId": "io.github.qmediat/gemini-code-context-mcp",
    "originalUrl": "https://registry.modelcontextprotocol.io/v0.1/servers/io.github.qmediat%2Fgemini-code-context-mcp/versions/latest",
    "isOfficial": true,
    "status": "active"
  }
}
gemini-code-context-mcp — MCP Server 安装与配置 · AgentHub