All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Project deprecated and unmaintained. Google is retiring Gemini CLI on 2026-06-18 in favor of Antigravity CLI. After that date, Gemini CLI stops serving requests for Google AI Pro, Ultra, and free-tier (Gemini Code Assist for individuals) accounts. Enterprise customers on paid Gemini Code Assist Standard/Enterprise licenses retain access. Because this bridge wraps Gemini CLI as a subprocess, it stops working for individual users on the same date.
- README updated with a prominent deprecation banner and migration pointers (Antigravity CLI, sibling claude-mcp-bridge / codex-mcp-bridge).
package.jsondescription prefixed with[DEPRECATED]so npmjs.com listings surface the status. The npm package will be marked deprecated (npm deprecate) and the GitHub repository archived after this release publishes.
No code changes in this release. Existing installs continue functioning until 2026-06-18.
reviewtool: bundled reviewer prompts + depth selector +stripReviewPreamble+ anchor sets. Caller-supplied prompts via the existingquerytool, or directgemini -pinvocation, replace it. The gemini ecosystem ships several review surfaces (Code Review extension, skills, subagents, Code Assist, third-party MCP servers); the bridge is the wrong layer to add another.assesstool: depth recommender calibrated toreview's depth grammar. Withoutreview, the rubric has no anchor.prompts/review-{agentic,focused,quick}.md: review prompt templates.policies/review.toml: review policy file.src/utils/git.ts: review/assess were the only consumers.
Rationale: docs/decisions/001-remove-review-and-assess-tools.md.
- Tool surface is now
query,structured,search,fetch-chunk,ping(5 tools). - README adds a "Code review with this CLI" section pointing to the gemini ecosystem's review surfaces in priority order.
server.jsondescription tightened to fit the 100-char registry limit.
changeModeonquerytool: opt-in flag that asks Gemini to emit structured**FILE: <path>:<start>-<end>**/===OLD===/===NEW===edit blocks instead of prose. LegacyOLD:/NEW:markers are still parsed per-block for back-compat. Parsed edits are returned on_meta.editsas a machine-applicable array (never chunked) while the raw response stays inresponse(chunked normally).- Change-mode write guardrail: pre/post-spawn snapshot of tracked-file mtime+size and
git status --porcelainunder the working directory. If Gemini mutates any file during the spawn,_meta.appliedWritesis set to true andeditsis omitted so callers can't re-apply half-applied state. Requires a git working directory. prompts/change-mode.mdtemplate: strict output contract instructing Gemini to emit edit blocks only, without applying writes.src/utils/changeMode.ts: edit-block parser with primary (:<start>-<end>) and bare (**FILE: <path>**, content-inferred range) header formats, path realpath check against the working directory, and same-file overlap rejection. Uses===OLD===/===NEW===section markers to avoid collision with legacyOLD:/NEW:lines that can appear naturally in YAML, config files, or string literals. LegacyOLD:/NEW:markers are still accepted as a fallback.src/utils/workdirSnapshot.ts: cheap tracked-file snapshot + diff used by the change-mode guardrail.query-change-modesmoke target:node scripts/smoke-test.mjs query-change-mode <repo>exercises the full change-mode path end-to-end.- MCP Registry manifest (
server.json): registers the bridge with the official MCP Registry so it shows up at registry.modelcontextprotocol.io and downstream aggregators (PulseMCP, FindMCP, VS Code@mcpgallery). mcpNameinpackage.json(io.github.hampsterx/gemini-mcp-bridge): required for Registry ownership verification on publish. Env var defaults inserver.jsonare strings per Registry validation.
- Change mode rejects image files for v1 and refuses to run in non-git working directories (the guardrail needs
git ls-files/git status). - Spawn uses default agentic mode (no
--approval-mode plan, no--yolo) because plan mode refuses to emit edit blocks (verified on CLI 0.38.0). The snapshot guardrail is the safety net against the default-mode write capability.
- Response chunking for
query,review, andsearch: oversized text responses now return chunk 1 plus cache metadata instead of risking MCP client truncation. Cache is in-memory, 10-minute TTL, max 50 entries, with logical-boundary chunk splitting where possible. fetch-chunktool: retrieves cached follow-up chunks usingcacheKeyand a 1-basedchunkIndex.- Chunking smoke coverage:
node scripts/smoke-test.mjs fetch-chunkvalidates the cache round-trip without restarting the MCP client. assesschange-kind classification:empty,code,mixed,non-code,generated. Returned alongside complexity so callers can decide whether a diff is worth reviewing at all. Documentation-only diffs are still reviewable by default rather than auto-dismissed as churn.assessguidance field: human-readable recommendation string tailored to the detected change kind and complexity.- Spawn pacing controls:
GEMINI_MIN_INVOCATION_GAP_MSenforces a minimum gap between CLI start times;GEMINI_SPAWN_JITTER_MAX_MSadds small randomized startup jitter. Concurrency limits and queue behavior unchanged. - Structured capacity-failure metadata for deep reviews: explicit 429 / 503 /
RESOURCE_EXHAUSTEDresponses surface as structured metadata on the review result instead of triggering an internal retry. Callers can now decide whether to back off, downgrade depth, or retry.
- Server response formatting: prose-style tool responses now flow through a shared formatter that can append metadata and apply chunking consistently.
structuredtool left unchunked intentionally: preserves machine-consumable JSON output instead of returning partial payloads.- Deep review no longer falls back internally on capacity errors: previously a 429 or 503 would trigger a retry. Now it returns structured capacity metadata for the caller. Other tools and review depths keep existing fallback behavior.
assesstool: zero-cost diff analysis pre-flight. Runsgit diff --numstatand--name-onlylocally (no CLI spawn, no model call) and returns diff stats, changed file list, complexity classification (trivial/moderate/complex), and suggestions for which review depth to use with estimated wall-clock times. Use beforereviewto set timeout expectations. Cross-cutting detection uses top-level directory count (3+ distinct dirs = complex).depthparameter onreview: three tiers replace the binary quick/agentic split.scan: diff-only, single-pass, no repo exploration. Constant 180s timeout.focused: diff + CLI reads changed files in plan mode (no shell). Timeout scales120s + 15s * files, capped at 300s; falls back to 240s when diff stat is unavailable.deep(default): full agentic exploration with--yolo. Timeout now scales240s + 45s * files(was180s + 30s * files), capped at 1800s; fallback 600s.
buildFocusedPrompt/prompts/review-focused.md: new prompt template for focused reviews. Instructs the CLI to read changed files only and acknowledges that some changed files may be unreadable (deleted, renamed-away, binary, generated, gitignored).scaleTimeoutForDepth,defaultTimeoutForDepth,resolveDepth: new exports onsrc/tools/review.tsfor per-depth timeout and input resolution.
ReviewResult.modevalues:"agentic" | "quick"→"scan" | "focused" | "deep". Breaking for callers inspectingresult.mode. Pre-1.0 so a minor bump covers this mechanically, but call it out: anyone checkingresult.mode === "quick"or=== "agentic"needs to update to the new values.- Deep (previously agentic) timeout scaling: per-file budget raised from 30s to 45s and base from 180s to 240s. A 10-file diff goes from 480s to 690s. The user explicitly picked
deep, so don't cut it short. - Partial response hint: timeout annotations now read
consider depth: "scan" or narrow the base(wasconsider quick: true or narrow the base). Scan timeouts are no longer annotated — no shallower alternative exists. - Tool description on
review: rewritten to explain the three depths and new timeout formulas.
quickparameter onreview: superseded bydepth. Still works for backwards compatibility:quick: true→depth: "scan",quick: false→depth: "deep".depthwins when both are set.
- Focused mode containment is prompt-driven, not CLI-enforced. Plan mode removes shell access but does not scope
read_file/grep_search/list_directoryto the changed files. Gemini could still read any non-gitignored file in the repo — the containment relies on the prompt instruction "Do NOT explore beyond the changed files" plus the reduced tool surface.
- Always-agentic query and structured tools: Both
queryandstructurednow run in agentic mode by default (--approval-mode plan). Gemini launches inside the working directory with read_file, grep, list_directory, and glob tools, exploring the repo for context instead of receiving pre-inlined file blobs. Text files are passed as@{path}hints, not inlined content. Image queries still use--yolofor native pixel access. - Default timeout raised to 120s for both
queryandstructured(was 60s for text queries). Plan mode boots the CLI tool system, which adds to the ~16s cold start. - Tool descriptions updated: Both tools now explicitly describe themselves as agentic. The
filesparameter documentation clarifies that contents are NOT inlined. - Footer label:
Files included:renamed toFiles hinted:in tool responses to reflect the new semantics (paths passed, Gemini may or may not have read them).
- File content inlining:
readFiles()andassemblePrompt()removed fromsrc/utils/files.ts. No text file content is pre-read or inlined into prompts.
- Gitignored files are unreadable in text-query mode (plan mode restriction). Image queries (
--yolo) can still read gitignored files. This is a CLI-level constraint with no bypass. - Breaking for callers relying on guaranteed file reads: Gemini now decides which hinted files are relevant. If a file isn't pertinent to the query, Gemini may skip it. Callers who depended on "Gemini definitely saw the contents of file X" should verify via the response.
- npm publish workflow: Run
npm publishvianpx --yes npm@latestinstead of corepack. OIDC trusted publishing requires npm ≥ 11.5.1 but Node 22 ships with npm 10.9.7, and neithernpm install -g npm@latest(v0.2.6, self-upgrade race breakspromise-retry) norcorepack prepare npm@latest --activate(v0.2.7, doesn't reroutenpmwithout apackageManagerfield inpackage.json) actually got a modern npm onto PATH. npx downloads the package fresh into a temp dir and runs its bin directly, which sidesteps both problems.
- v0.2.6 and v0.2.7 never reached the registry: both publish jobs aborted before
npm publishcompleted.npm view gemini-mcp-bridge versionstill shows 0.2.5 immediately before this release.
- MCP tool annotations: Tools declare
readOnlyHint,destructiveHint,openWorldHint, andidempotentHintso MCP clients can make informed permission and caching decisions. - Execution metadata: All tool results now include
executionTime,timedOut, andresolvedModelfields alongside the response. - Rich tool descriptions: Tool descriptions include parameter docs and usage examples, rendered inline for clients that display them.
- Progress heartbeats: Long-running operations emit MCP progress notifications so clients can show activity indicators instead of appearing stalled.
- MCP transport wiring tests: 7 new tests verifying server tool registration, stdio transport, and progress token propagation.
- CI smoke step:
npm run smoke:ciruns a minimal MCP handshake in CI to catch wiring regressions.
- Stream-JSON output format: Switch from
--output-format jsonto--output-format stream-json(NDJSON) for progressive capture. Timeouts now return partial responses instead of generic error messages. - Smoke test script:
npm run smoke/scripts/smoke-test.mjsfor testing tool functions directly without restarting the MCP client. Supports all four tools with configurable workingDirectory. - Resolved working directory: All tool results now include
resolvedCwdshowing the actual directory used after git root resolution and path validation. - Latency budget documentation: Document ~16s CLI cold start, per-layer timing breakdown, and implications for timeout configuration in CLAUDE.md and README.
parseStreamJson()replacesparseGeminiOutput()as the primary parser, with automatic fallback to legacy JSON parsing for older CLI versions.tryParsePartial()extracts partial content from NDJSON on timeout, forwarding stderr for fallback parsing.- Smoke test timeouts aligned with real CLI cold start times (60-120s).
- Response length awareness: Optional
maxResponseLengthparameter (in words) on query, search, and review tools. Appends a soft length instruction to the prompt. - Conciseness guidance in review and search prompt templates to reduce verbose output by default.
buildLengthLimit()andappendLengthLimit()helpers insrc/utils/prompts.ts.GEMINI_DEFAULT_MODELenv var support for default model selection.- Auto-retry with fallback model on quota exhaustion (
GEMINI_FALLBACK_MODELenv var). - 10 new tests for response length controls.
maxResponseLengthzod schemas enforce.int().positive().
searchtool: Google Search grounded queries. Spawns CLI in agentic mode withgoogle_web_search, synthesizes answers with source URLs. Default 120s timeout.structuredtool: JSON output conforming to a provided JSON Schema, with validation.- Image support in
query: Image files (png, jpg, jpeg, gif, webp, bmp) trigger agentic mode so the CLI reads them natively. Text files still inlined as before. Mixed text+image queries supported. 5MB size limit for images (vs 1MB for text). src/utils/errors.ts: SharedcheckErrorPatterns()for consistent auth/rate-limit error handling across all tools.isImageFile()andIMAGE_EXTENSIONShelpers insrc/utils/files.ts.- 23 new tests (query tool: 11, search tool: 8, isImageFile: 4).
- Review tool now checks for rate-limit/quota errors (previously only checked auth errors).
- File reads in
readFiles()run in parallel viaPromise.allinstead of sequentially. - Image path validation runs in parallel.
- Review prompts extracted from inline template literals to standalone markdown files in
prompts/, loaded at runtime vialoadPrompt().
- Prompt placeholder replacement no longer corrupts diffs containing
{{word}}patterns (Handlebars, Go templates, etc.). loadPromptnow usesbasename()to prevent path traversal.
- 9 tests for prompt template loading and placeholder substitution.
- Agentic code review (default): Spawns Gemini CLI with
--yoloinside the target repo. The CLI runsgit diffitself, reads full files, follows imports, checks tests, and reads project instruction files (CLAUDE.md, GEMINI.md, AGENTS.md, etc.) for context-aware reviews. quickparameter on review tool: settrueto skip repo exploration and get a fast diff-only review (previous behavior).focusparameter on review tool: direct attention to specific areas (e.g. "security", "performance", "error handling").- Bundled
policies/review.tomlfor future policy-based shell filtering (waiting on upstream CLI fix google-gemini/gemini-cli#20469).
- JSON output parsing: Gemini CLI with
--output-format jsonwrites JSON to stderr in newer versions. Parser now checks both stdout and stderr.
pingauth detection: validate OAuth cred types instead of trusting shape- Return "unknown" for malformed/partial OAuth creds (missing both refresh_token and expiry_date)
- Distinguish ENOENT (return "missing") from parse/permission errors (return "unknown") in catch block
querytool: one-shot Gemini queries with optional file contextreviewtool: code review via native git-diff sent to Geminipingtool: health check and CLI capability detection- Hardened subprocess environment (minimal env allowlist)
- Path sandboxing (realpath validation, traversal prevention)
- Concurrency limiter (max 3 concurrent spawns, FIFO queue)
- Configurable timeouts with 600s hard cap
- JSON output parsing with ANSI-strip fallback