Gemini Code Context MCP
An MCP server that wraps Google's Gemini API to provide long-context memory for codebases within hosts like Claude Code. It performs a single workspace scan and leverages Gemini's 1M-token window with implicit prefix caching or explicit Context Cache to reduce latency and token costs for repeat queries. It supports agentic file access for larger repositories and allows model overrides via environment variables or per-call parameters.
Package and access
Local package with source-attributed installation metadata. Koskamo does not execute packages during review.
What you can do with it
- Perform codebase Q&A using long-context memory
- Reduce latency for repeat queries via implicit caching
- Access files agenticly in larger repositories
- Override default models via environment variables
Source and maintenance
- Maintenance checked
Packages and installation
Source-provided package data. Koskamo has not executed or live-probed this package.
@qmediat.io/gemini-code-context-mcp 1.20.0
{
"version": "1.20.0",
"transport": "stdio",
"identifier": "@qmediat.io/gemini-code-context-mcp",
"registryType": "npm",
"environmentVariables": [
{
"name": "GEMINI_CREDENTIALS_PROFILE",
"format": "string",
"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",
"format": "string",
"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."
},
{
"name": "GEMINI_USE_VERTEX",
"format": "string",
"description": "Set to `true` to use Vertex AI backend via Application Default Credentials. Requires GOOGLE_CLOUD_PROJECT."
},
{
"name": "GOOGLE_CLOUD_PROJECT",
"format": "string",
"description": "GCP project ID when using Vertex AI backend. Only read when GEMINI_USE_VERTEX=true."
},
{
"name": "GEMINI_DAILY_BUDGET_USD",
"format": "string",
"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",
"format": "string",
"description": "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."
},
{
"name": "GEMINI_CODE_CONTEXT_CACHING_MODE",
"format": "string",
"description": "`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."
},
{
"name": "GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS",
"format": "string",
"description": "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."
},
{
"name": "GEMINI_CODE_CONTEXT_LOG_LEVEL",
"format": "string",
"description": "`debug` | `info` | `warn` | `error`. Default: `info`."
}
]
}Tools
Reported by the attributed source; not independently observed by Koskamo.
Connect from your client
Each snippet configures the same source-provided package; replace placeholders before use.
Cursor
{
"mcpServers": {
"gemini-code-context-mcp": {
"command": "npx",
"args": [
"-y",
"@qmediat.io/gemini-code-context-mcp@1.20.0"
],
"env": {
"GEMINI_CREDENTIALS_PROFILE": "<YOUR_GEMINI_CREDENTIALS_PROFILE>",
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"GEMINI_USE_VERTEX": "<YOUR_GEMINI_USE_VERTEX>",
"GOOGLE_CLOUD_PROJECT": "<YOUR_GOOGLE_CLOUD_PROJECT>",
"GEMINI_DAILY_BUDGET_USD": "<YOUR_GEMINI_DAILY_BUDGET_USD>",
"GEMINI_CODE_CONTEXT_DEFAULT_MODEL": "<YOUR_GEMINI_CODE_CONTEXT_DEFAULT_MODEL>",
"GEMINI_CODE_CONTEXT_CACHING_MODE": "<YOUR_GEMINI_CODE_CONTEXT_CACHING_MODE>",
"GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS": "<YOUR_GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS>",
"GEMINI_CODE_CONTEXT_LOG_LEVEL": "<YOUR_GEMINI_CODE_CONTEXT_LOG_LEVEL>"
}
}
}
}Cline
{
"mcpServers": {
"gemini-code-context-mcp": {
"command": "npx",
"args": [
"-y",
"@qmediat.io/gemini-code-context-mcp@1.20.0"
],
"env": {
"GEMINI_CREDENTIALS_PROFILE": "<YOUR_GEMINI_CREDENTIALS_PROFILE>",
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"GEMINI_USE_VERTEX": "<YOUR_GEMINI_USE_VERTEX>",
"GOOGLE_CLOUD_PROJECT": "<YOUR_GOOGLE_CLOUD_PROJECT>",
"GEMINI_DAILY_BUDGET_USD": "<YOUR_GEMINI_DAILY_BUDGET_USD>",
"GEMINI_CODE_CONTEXT_DEFAULT_MODEL": "<YOUR_GEMINI_CODE_CONTEXT_DEFAULT_MODEL>",
"GEMINI_CODE_CONTEXT_CACHING_MODE": "<YOUR_GEMINI_CODE_CONTEXT_CACHING_MODE>",
"GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS": "<YOUR_GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS>",
"GEMINI_CODE_CONTEXT_LOG_LEVEL": "<YOUR_GEMINI_CODE_CONTEXT_LOG_LEVEL>"
}
}
}
}VS Code
{
"servers": {
"gemini-code-context-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@qmediat.io/gemini-code-context-mcp@1.20.0"
],
"env": {
"GEMINI_CREDENTIALS_PROFILE": "<YOUR_GEMINI_CREDENTIALS_PROFILE>",
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"GEMINI_USE_VERTEX": "<YOUR_GEMINI_USE_VERTEX>",
"GOOGLE_CLOUD_PROJECT": "<YOUR_GOOGLE_CLOUD_PROJECT>",
"GEMINI_DAILY_BUDGET_USD": "<YOUR_GEMINI_DAILY_BUDGET_USD>",
"GEMINI_CODE_CONTEXT_DEFAULT_MODEL": "<YOUR_GEMINI_CODE_CONTEXT_DEFAULT_MODEL>",
"GEMINI_CODE_CONTEXT_CACHING_MODE": "<YOUR_GEMINI_CODE_CONTEXT_CACHING_MODE>",
"GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS": "<YOUR_GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS>",
"GEMINI_CODE_CONTEXT_LOG_LEVEL": "<YOUR_GEMINI_CODE_CONTEXT_LOG_LEVEL>"
}
}
}
}Claude Desktop
{
"mcpServers": {
"gemini-code-context-mcp": {
"command": "npx",
"args": [
"-y",
"@qmediat.io/gemini-code-context-mcp@1.20.0"
],
"env": {
"GEMINI_CREDENTIALS_PROFILE": "<YOUR_GEMINI_CREDENTIALS_PROFILE>",
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"GEMINI_USE_VERTEX": "<YOUR_GEMINI_USE_VERTEX>",
"GOOGLE_CLOUD_PROJECT": "<YOUR_GOOGLE_CLOUD_PROJECT>",
"GEMINI_DAILY_BUDGET_USD": "<YOUR_GEMINI_DAILY_BUDGET_USD>",
"GEMINI_CODE_CONTEXT_DEFAULT_MODEL": "<YOUR_GEMINI_CODE_CONTEXT_DEFAULT_MODEL>",
"GEMINI_CODE_CONTEXT_CACHING_MODE": "<YOUR_GEMINI_CODE_CONTEXT_CACHING_MODE>",
"GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS": "<YOUR_GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS>",
"GEMINI_CODE_CONTEXT_LOG_LEVEL": "<YOUR_GEMINI_CODE_CONTEXT_LOG_LEVEL>"
}
}
}
}Let your agent find its tools
Find servers like Gemini Code Context MCP from your agent. Add Koskamo once to search the index for endpoints, access requirements, and client setup. Public discovery needs no key.