Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GEMINI_BINARYNoExplicit path to the gemini binary. When set, auto-discovery is skipped entirely. Useful when gemini is installed via nvm/fnm and not on the PATH that MCP servers see.
GEMINI_MODELSNoComma-separated model IDs to override the default curated list exposed by the gemini://models resource.
GEMINI_JOB_GC_MSNoJob garbage-collection interval (ms).60000
GEMINI_POOL_SIZENoNumber of pre-spawned warm processes per server.1
GEMINI_JOB_TTL_MSNoHow long completed/failed/cancelled jobs are retained (ms).300000
GEMINI_SESSION_DBNoSQLite path. :memory: = ephemeral.~/.gemini-cli-mcp/sessions.db
GEMINI_MAX_RETRIESNoAuto-retries on empty-stdout/429/ETIMEDOUT. 0 = disabled.3
GEMINI_CACHE_TTL_MSNoResponse cache TTL (ms). 0 = disabled.300000
GEMINI_POOL_ENABLEDNo0 = disable warm pool (cold spawn only).1
GEMINI_ORPHAN_REAPERNo0 = disable the startup sweep that reaps orphaned gemini --yolo --output-format stream-json workers belonging to the current user. POSIX-only.1
GEMINI_POOL_MIN_SIZENoFloor the pool can shrink to during idle eviction. Must be ≤ GEMINI_POOL_SIZE.0
GEMINI_RETRY_BASE_MSNoBase delay for exponential backoff (doubles each retry).1000
GEMINI_MAX_CONCURRENTNoMax parallel Gemini subprocesses.2
GEMINI_SKIP_DETECTIONNo1 = skip CLI version/flag detection at startup (use hardcoded defaults).0
GEMINI_POOL_STARTUP_MSNoEstimated CLI startup time (ms). Prompt writes are delayed by this amount after spawn.12000
GEMINI_STRUCTURED_LOGSNo1 = emit one JSON telemetry line to stderr per request.0
GEMINI_QUEUE_TIMEOUT_MSNoMax wait for a concurrency slot (ms).60000
GEMINI_CACHE_MAX_ENTRIESNoMax entries in the response cache.50
GEMINI_DISABLE_PDEATHSIGNo1 = skip the setpriv --pdeathsig TERM wrapper around child spawns (Linux only). Only the literal string "1" disables.0
GEMINI_MAX_HISTORY_TURNSNoSession history window (turn-pairs). 0 = unlimited.20
GEMINI_POOL_IDLE_TIMEOUT_MSNoTime of no acquire() calls after which the pool shrinks to GEMINI_POOL_MIN_SIZE. 0 disables eviction.300000

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{}
logging
{}
prompts
{}
resources
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
ask-geminiA

Start a new conversation with Gemini. If the MCP client supports progress notifications (progressToken present), blocks and streams partial responses as notifications/progress events, then returns the final response inline. Otherwise returns immediately with { jobId, sessionId }; poll with gemini-poll or cancel with gemini-cancel.

gemini-replyA

Continue an existing Gemini conversation. If the MCP client supports progress notifications (progressToken present), blocks and streams partial responses as notifications/progress events, then returns the final response inline. Otherwise returns immediately with { jobId }; poll with gemini-poll. Includes history truncation metadata when older turns are omitted. Throws if the session has a pending job.

gemini-pollA

Poll the status of an async Gemini job started by ask-gemini or gemini-reply. Returns status, partial response (while pending), or the full response (when done). Recommended poll interval: 2000ms. Jobs typically complete in 16–20s.

gemini-cancelA

Cancel an in-flight Gemini job. Sends SIGTERM to the subprocess. Idempotent: if the job is already done, returns { cancelled: false, alreadyDone: true }.

gemini-healthA

Return runtime diagnostics: binary path, env overrides, pool/semaphore concurrency and pool errors, job totals with per-status counts, session count, server uptime, CLI version/flag detection status, and active flag adaptations.

gemini-sessionsA

List or export Gemini sessions. If sessionId is omitted, returns the list of active sessions (id, lastAccessed, turnCount, expiresAt). If sessionId is provided, returns the full conversation history (turns + pre-rendered content) in the requested format.

gemini-batchA

Run multiple independent prompts in parallel, leveraging the existing concurrency infrastructure (semaphore + warm pool). Useful for parallel code review, multi-file analysis, and test generation — replacing N sequential ask-gemini calls with a single request. Returns all results when complete (wait: true, default) or job IDs for polling (wait: false). Individual failures are isolated: other items still complete successfully.

gemini-researchA

Run a research-oriented Gemini query. Supports quick, standard, and deep investigation modes. By default (wait: true), blocks and returns the full answer inline; with wait: false, returns a jobId for polling.

Prompts

Interactive templates invoked by user choice

NameDescription
code-reviewReview code files for issues. Pass file paths/globs as `files`, optionally narrow with `focus`.
architecture-analysisAnalyse the architecture of a codebase directory. Optionally answer a specific architectural question.
explain-codeExplain how a source file works, optionally scoped to a single symbol and tailored to an audience level.
debug-errorDebug an error message or stack trace. Optionally supply relevant source files and context.

Resources

Contextual data attached and managed by the client

NameDescription
Server HealthRuntime diagnostics: binary path, pool/semaphore concurrency, active jobs, session count, and server uptime.
Sessions ListAll active sessions with id, lastAccessed timestamp, and turn count.
Pending JobsAll currently pending jobs with id and createdAt timestamp.
Gemini ModelsCurated list of Gemini models with tier, description, and notes. Honors the GEMINI_MODELS env var (comma-separated IDs) as an override.

TDQS

A3.9/5.0

Scored across 8 tools

Disambiguation4/5

Each tool maps to a distinct operation in the async job/session lifecycle (start, reply, poll, cancel), with batch and research as clearly described variants. The main risk is ask-gemini vs gemini-research, since 'research-oriented query' reads like ask-gemini with a deeper mode, which could cause misselection. Overall boundaries are mostly clear thanks to the descriptions.

Naming Consistency4/5

Seven tools follow a predictable gemini-<action> prefix pattern, making the set easy to scan. The single outlier ask-gemini reverses the convention, and a few suffixes are nouns (gemini-health, gemini-sessions) rather than verbs, but the pattern remains readable.

Tool Count5/5

Eight tools are well-scoped for a Gemini CLI wrapper: one per lifecycle stage (start, reply, poll, cancel), plus batch, research, sessions, and health. Nothing feels redundant or missing at this count.

Completeness4/5

The full async lifecycle is covered, including start, continue, poll, cancel, plus batch parallelism, session listing/export, and runtime diagnostics. Minor gaps like session cleanup/deletion or model/config selection are workarounds an agent could handle, but the surface is close to complete.

Maintenance

ActivityInactive
ResponsivenessLimited data